feat(icu): implement buffer termination exports #17804
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/17804"
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 DonRyuzaki on 2026-11-09T16:49:13Z.
What
Implement the 3.20
libSceIcuexportsu_terminateChars(PuLoqDSNPPw) andu_terminateUChar32s(TuExC-Sja8o). Both follow ICU's buffer termination status rules: write NUL when space remains, reportU_STRING_NOT_TERMINATED_WARNINGat exact capacity, and reportU_BUFFER_OVERFLOW_ERRORwhen the length exceeds capacity. Calls with a prior failure or a negative length leave the status and buffer alone. A null destination throws only when the call would write to it.The two legacy placeholders are removed, and a focused guest test covers boundary lengths, all status classes, untouched sentinels and null destinations. The console ABI and behavior remain unverified and are recorded in technical debt.
Scope check: #14144 already implements
u_terminateUCharsand the twouprv_isInvariant*helpers from my older unpublished five-helper branch, so those are excluded here. The still-open #17297 names these same two NIDs as throwing aliases; this PR adds their behavior and does not depend on #17297. The branches overlap in the legacy export files. Whichever merges second must rebase and remove the duplicate throwing definitions and declarations so each NID remains exported once.Tested
Latest update (2026-11-12): Pushed head
2e60137227d07533bbf309ffaf648896f68b2093includes Dean’s requested debt correction: 1689 of 2347 named exports, both termination functions in the implemented list, and 654 remaining placeholder names. It merges cleanly with upstreamd78d7858043d6442ae68c82b4e4e9fe87945ed90. On the preceding code-identical headad80c33dabd47d07323fd7247d0825fe01c9a7a6, the full Linuxlibstarget andguest_icu_terminate_buffer_testsbuilt over upstreamdbf944245d55084dded6c74b490e9d3108412084;guest_icu_terminate_bufferpassed three CTest repeats. The final commit changes only the debt text.check_conventions.pyandgit diff --checkpassed on the final patch. Hosted checks for the latest head are pending; no hosted result is claimed yet.Merged upstream main
dff7484fd1ba7b6827c355a0524e191c47073e76into the existing branch; then-pushed headb298ebc2a55eee366f2c0d0ff4d0a5a1113b2aa1. The only merge conflict was the ICU CMake list. It now retains upstreamLanguageTag.cpp, this PR'sTerminateBuffer.cpp, and both focused test registrations alongside LocaleCore. The worktree is clean.git diff --check dff7484fd1ba7b6827c355a0524e191c47073e76...HEAD: passed.python3 tools/check_conventions.py --base origin/main: passed on the merged branch.BUILD_TESTING=ON: overlaid the eight exact PR files on a clean, pinneddff7484source tree and built the fulllibstarget plus focused ICU test targets successfully (861 Ninja steps). The generatedlibSceIcu.prxwas NID-patched.guest_icu_terminate_buffer,guest_icu_language_tag,guest_icu_locale_core, andpublic_headerseach passed three CTest repeats (12/12 runs, no failures). SHA-256: unpatchedaa706ee28a97c082dbe14ae9cc7c324e50db785ff4d52f6805187a1cfcec8f32; patchedc18e9ddef0c44469977e46857262677f6b9af9fcc261c6fa2674ce32d841f782.No console, game, local Windows or macOS focused test, or full project test-suite result is claimed.
Checklist
main; #17297 declares the same NIDs as throwing aliases but does not implement their behaviorNotImplemented_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)