init(validatingPlatformString:)
Creates a string by interpreting the null-terminated platform string as UTF-8 on Unix and UTF-16 on Windows.
Declaration
init?(validatingPlatformString platformString: [CInterop.PlatformChar])Parameters
- platformString:
The null-terminated platform string to be interpreted as
CInterop.PlatformUnicodeEncoding.
Discussion
Note It is a precondition that
platformStringmust be null-terminated. The absence of a null byte will trigger a runtime error.
If the contents of the platform string isn’t well-formed Unicode, this initializer returns nil.