We found in https://bugs.webkit.org/show_bug.cgi?id=164311 that converting the char* returned by -[NSURL fileSystemRepresentation] to a String will interpret a UTF-8 sequence as Latin-1. We should audit our code to see if we are making this mistake elsewhere.
<rdar://problem/29070750>
<rdar://problem/29070757>
And as I mentioned in that bug, generally if we want to make a String, we probably don’t want use -[NSURL fileSystemRepresentation]. I believe we can use either -[NSURL path] or CFURLCopyFileSystemPath instead to avoid the encoding/decoding process.