init(validating:)
Creates a string from a path component, validating its contents as UTF-8 on Unix and UTF-16 on Windows.
Declaration
init?(validating component: FilePath.Component)Parameters
- component:
The path component to be interpreted as
CInterop.PlatformUnicodeEncoding.
Discussion
If the contents of the path component isn’t a well-formed Unicode string, this initializer returns nil.