Contents

init(platformString:)

Creates a string by interpreting the null-terminated platform string as UTF-8 on Unix and UTF-16 on Windows.

Declaration

init(platformString: UnsafePointer<CInterop.PlatformChar>)

Parameters

  • platformString:

    The null-terminated platform string to be interpreted as CInterop.PlatformUnicodeEncoding.

Discussion

If the content of the platform string isn’t well-formed Unicode, this initializer replaces invalid bytes with U+FFFD. This means that, depending on the semantics of the specific platform, conversion to a string and back might result in a value that’s different from the original platform string.