input.webkitEntries does not work as expected when folder contains accented chars
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Apr 2018 17:37:31 +0000 (17:37 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Apr 2018 17:37:31 +0000 (17:37 +0000)
commit24d7a584db780298b42f0c86fab43105d0a061ff
tree53d84d1b5b1ecaa2154f35f7193cef136cd9ccaf
parentca9dd73c00d2c0b9459f5fc236b4cf7c3671e1c5
input.webkitEntries does not work as expected when folder contains accented chars
https://bugs.webkit.org/show_bug.cgi?id=184517
<rdar://problem/39265537>

Reviewed by Alex Christensen.

Source/WebCore:

Use String::fromUTF8() to construct a WTF String from the char* returned by
dirname() in FileSystem::directoryName(). Previously, we were just calling
the String constructor, which would treat the input as latin 1 instead of
UTF-8.

Change is covered by an API test rather than a layout test due to file versioning
limitations.

* platform/posix/FileSystemPOSIX.cpp:
(WebCore::FileSystem::directoryName):

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebCore/FileSystem.cpp:
(TestWebKitAPI::TEST_F):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230639 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/posix/FileSystemPOSIX.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebCore/FileSystem.cpp