Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WebDriver][socket] Titles containing multibyte characters cannot be …
…retrieved correctly https://bugs.webkit.org/show_bug.cgi?id=270063 Reviewed by Alexey Proskuryakov. If the document title contains multibyte characters such as Japanese or entity references, the "Get Title" result will be garbled. The title string is obtained by JavaScript's "document.title()", and this data is encoded in UTF8. However, the StringBuilder.append() function used to create HTTP messages uses fromLatin1() internally to generate strings from byte data. This seems to be causing the multibyte characters to be garbled. This patch changes to use String::fromUTF8() before concatenation to restore the correct WTF::String even if it contains multibyte characters. Also, the change of get.py is regression test for this issue. This is an export from web-platform-tests/wpt#46584. * Source/WebDriver/socket/HTTPServerSocket.cpp: (WebDriver::HTTPRequestHandler::packHTTPMessage const): * WebDriverTests/imported/w3c/webdriver/tests/classic/get_title/get.py: (test_strip_and_collapse): (test_title_included_entity_references): (test_title_included_multibyte_char): Canonical link: https://commits.webkit.org/279767@main
- Loading branch information