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®</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.
Pull request: https://github.com/WebKit/WebKit/pull/25085
<rdar://problem/123987149>
Committed 279767@main (0a3175f4f36a): <https://commits.webkit.org/279767@main> Reviewed commits have been landed. Closing PR #25085 and removing active labels.