feat(libSceIcu): implement u_uastrcpy and u_uastrncpy #22862
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/22862"
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 Callimann8 on 2026-11-18T13:00:31Z.
What
Implements
u_uastrcpyandu_uastrncpyin libSceIcu. Both were stubs inLegacyExports.cpp; they now live inInvariant.cppnext to their narrowing counterpartsu_austrcpyandu_austrncpy, and follow ICU 78.1'sustr_cnv.cppthe same way:u_uastrcpywidens a NUL-terminated byte string to UTF-16, terminator included, and returns the destination.u_uastrncpywidens at mostnbytes, writes one NUL when the source ends beforen(no zero padding), and writes nothing for a nonpositive count.0x7fthrowNotImplemented_nid_no_patch, because the console's default converter is unknown.u_uastrcpy, with a positive count foru_uastrncpy) throw an invalid-argument exception, as the existingu_austr*helpers do.Tested
Linux (Ubuntu 24.04, GCC 13.3, Release).
guest_icu_version_testsgainsUaStrcpyandUaStrncpycases: empty string, every byte0x01–0x7f, truncation, exact length, a single terminator without padding, an unterminated source bounded by the count, nonpositive counts and null pointers. All 63 libSceIcu tests (ctest -R guest_icu) pass on this branch.tools/check_conventions.py --base origin/mainandtools/debt_fold.py --checkpass. Not tested on a console.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-18T13:03:11Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
324a6a29b7:tools/check_conventions.pypassed.guest_icu_version_testsbuilt cleanly.guest_icu_version):core/libs/prx/libSceIcu/Invariant.cpp,core/libs/prx/libSceIcu/Invariant.hpp,core/libs/prx/libSceIcu/LegacyExports.cpp,core/libs/prx/libSceIcu/include/LegacyExports.hppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me