feat(libSceNKWebKit): implement WTF::encodeWithURLEscapeSequences #16901
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16901"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by AlexWhitehouse on 2026-11-07T21:11:19Z.
What
libSceNKWebKit
WTF::encodeWithURLEscapeSequences(const WTF::String&)(_ZN3WTF28encodeWithURLEscapeSequencesERKNS_6StringE, NID3DqiPW3mayI) threwnot implemented. This PR ports it from the PS5 WebKit tree the other NKWebKit ports use, 80f77e94:URL.cpppercentEncodeCharacterswithURLParser::isInUserInfoEncodeSet;URLParser.cpp's character table.Behaviour:
StringImplcomes back with one more reference, asreturn inputdoes upstream.%XXwith uppercase hex; the rest are copied.StringImpl::utf8does at that revision, unpaired surrogates in the middle become U+FFFD, and a trailing unpaired high surrogate keeps its three-byte encoding. The conversion uses the existingStringView::utf8export.StringImpl::create.The new source starts with the notices of
URL.cppandURLParser.cpp. The stub and its inventory row are removed, the NKWebKit count drops from 6368 to 6367, and a debt entry records that the console ABI and behaviour are unverified.Tested
nkwebkit_wtfurlescape(core/libs/prx/libSceNKWebKit/tests/WtfUrlEscape.cpp) covers:a b/@%becomesa%20b%2F%40%.main, the test fails with…encodeWithURLEscapeSequencesERKNS_6StringE not implemented;nkwebkit_wtfurlescape,nkwebkit_wtftext,nkwebkit_wtftext_allocationandpublic_headerspass.nkwebkit_wtfurlescape,nkwebkit_wtftextandnkwebkit_wtftext_allocationpass at 43346398bc, with no compiler warnings in the changed files.python3 tools/check_conventions.py --base origin/main: all checks passed.python3 tools/pr_overlap.py: no open PR implements this export.simplifyWhiteSpace). Whichever merges second recounts.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-07T22:15:42Z.
Review: COMMENTED
Read
43346398bcagainstmain.ShouldEncodematches theUserInfobit of URLParser.cpp's table at80f77e94character for character, plus everything above 0x7E, and the hex is uppercase asupperNibbleToASCIIHexDigitgives. Splitting the conversion into a mode-2 prefix and a mode-0 trailing lead reproduces upstream's lenientconvertUTF16ToUTF8: interior and lone low surrogates become U+FFFD, and only a final unpaired lead keeps three bytes. That split is needed becausemain'sToUTF8mode 0 keeps every lone surrogate. Null and unchanged strings return the same impl with one more reference, asreturn inputdoes, and the{0xDBFF}empty-prefix case is safe becauseCopyCStringreturns a non-null buffer for zero bytes. I found no defect. The 6368 to 6367 count is right for currentmain; whichever of #16890 and #16853 merges after this has to recount.Not run here; this is from reading the code.
AI-assisted: yes.