Bug 164330 - Audit uses of -[NSURL fileSystemRepresentation] for encoding mistakes
Summary: Audit uses of -[NSURL fileSystemRepresentation] for encoding mistakes
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-11-02 11:11 PDT by Andy Estes
Modified: 2017-06-05 09:30 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Estes 2016-11-02 11:11:50 PDT
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.
Comment 1 Radar WebKit Bug Importer 2016-11-02 11:13:10 PDT
<rdar://problem/29070750>
Comment 2 Radar WebKit Bug Importer 2016-11-02 11:13:53 PDT
<rdar://problem/29070757>
Comment 3 Darin Adler 2016-11-05 15:44:21 PDT
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.