feat(libSceIcu): decode default-encoded copies as UTF-16 #26469
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/26469"
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 ynkmyz233 on 2026-11-24T00:41:54Z.
What
Complete
u_uastrcpyandu_uastrncpyby decoding byte strings into UTF-16 with ICU's current default converter. The bounded copy uses the count for both source bytes and destination UTF-16 units. Both exports copy through checked guest memory and release the converter through the existing cache. Bundled ICU referenceThe branch check reports overlapping edits in
Invariant.cppwith #22132 and in the technical debt entry with #25957. #22132 checks guest pointers in other invariant copy routines. #25957 covers conversion in the opposite direction. Both conversion directions can run independently. The manually reviewed branch diffs for #13589, #14144, #14340, and #14443 contain the older ASCII-only copies.Tested
Windows 10 x64 (19045), MinGW-w64 GCC 15.2.0, Release. Passed
guest_icu_version,guest_icu_converter_helpers, andguest_icu_data_memory. The version test compares the guest exports against both bundled ICU routines, including malformed and truncated UTF-8, exact capacity, a supplementary character at an internal chunk boundary, and an ISO-8859-1 default.Passed
tools/check_conventions.py,tools/debt_fold.py --check, and the public-header audit. Console behavior remains unverified.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)Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-24T00:44:45Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
cdd937c4aa:tools/check_conventions.pypassed.guest_icu_version_testsbuilt cleanly.guest_icu_version):core/libs/prx/libSceIcu/Invariant.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by catminou4 on 2026-11-24T09:30:31Z.
Review: COMMENTED
Built
libSceIcuand ranguest_icu_version_testson Linux (x86-64, GCC 11): passes.Control — reverted
Invariant.cpptoorigin/main, kept the newDefaultEncodingDecodetest: the test aborts with "u_uastrcpy_nid_postfix not implemented". Onmainthese exports are stubs; this PR implements them.u_uastrcpy/u_uastrncpynow decode the default encoding to UTF-16 through the bundled ICU converter, following ICU 78.1ustr_cnv.cpp. The test is a genuine differential check against the bundled ICU's ownu_uastrcpy/u_uastrncpy: it covers empty input, ASCII, 2-byte and 4-byte UTF-8, a truncated multi-byte sequence, invalid bytes, and — for every input — every bounded count 0..10, asserting identical output and termination. It also checks the exact-fit no-terminator case and a 2047-char boundary.The debt fragment is precise about the semantics (positive count bounds both input bytes and output units, NUL written only when there is room, unbounded rejects input beyond ICU's signed length) and honest that the console's default encoding and non-ASCII behavior are unverified. Clean, mergeable feat.