Contents

init(validating:)

Creates a string from a file path, validating its contents as UTF-8 on Unix and UTF-16 on Windows.

Declaration

init?(validating path: FilePath)

Parameters

  • path:

    The file path to be interpreted as CInterop.PlatformUnicodeEncoding.

Discussion

If the contents of the file path isn’t a well-formed Unicode string, this initializer returns nil.