RESOLVED FIXED 270063
[WebDriver][socket] Titles containing multibyte characters cannot be retrieved correctly
https://bugs.webkit.org/show_bug.cgi?id=270063
Summary [WebDriver][socket] Titles containing multibyte characters cannot be retrieve...
haruhisa.shin
Reported 2024-02-25 20:07:29 PST
This is a problem with the WebDriver of socket implementation. I have confirmed this problem with wincairo and playstation. If the document title contains multibyte characters such as Japanese or entity references, the "Get Title" result will be garbled. For example: <title>foobar&reg;</title> <title>日本語</title> The title is obtained by JavaScript's "document.title()" and is UTF-8 encoded in WebDriverService::sendResponse. https://github.com/WebKit/WebKit/blob/main/Source/WebDriver/WebDriverService.cpp#L332 However, when the result is concatenated in HttpServer, StringBuilder.append decodes the characters with fromLatin1(). This seems to be causing the multibyte characters to be garbled. https://github.com/WebKit/WebKit/blob/main/Source/WebDriver/socket/HTTPServerSocket.cpp#L131 https://github.com/WebKit/WebKit/blob/main/Source/WTF/wtf/text/StringBuilder.h#L233 I think that String::fromUTF8() should be used before concatenating strings.
Attachments
haruhisa.shin
Comment 1 2024-02-25 22:29:07 PST
Radar WebKit Bug Importer
Comment 2 2024-03-03 20:08:14 PST
EWS
Comment 3 2024-06-06 00:09:40 PDT
Committed 279767@main (0a3175f4f36a): <https://commits.webkit.org/279767@main> Reviewed commits have been landed. Closing PR #25085 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.