feat(libSceIcu): implement 13 native-backed converter exports #16611
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16611"
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 hyvvs on 2026-11-07T09:29:53Z.
What
Implement 13 guest-callable
libSceIcuconverter exports with typedAPS5_VABIwrappers around pinned ICU 78.1:ucnv_open,ucnv_close,ucnv_getName,ucnv_reset,ucnv_resetToUnicode,ucnv_resetFromUnicode,ucnv_setFallback,ucnv_setSubstChars,ucnv_toUChars,ucnv_fromUChars,ucnv_toUnicode,ucnv_fromUnicode, anducnv_convertEx.Open/close owns a real native ICU converter object. Operations propagate the native
UErrorCodethrough a separate 32-bit guest status;UCharis 16-bit andUBoolis 8-bit. Streaming conversions update caller-owned input/output cursor pointers, preserve offsets and partial-state handling, and respect preflights, small buffers, substitution, fallback and resets.ucnv_getNamereturns a converter-owned borrowed string. Unknown or unavailable encodings return actual ICU errors rather than fake success. No guest callbacks are forwarded across a mismatched native calling convention.Dependency / stacked diff: #13578 is a separate contributor's pinned-ICU backend; this branch includes its unchanged ICU 78.1 source pin
049e0d6a420629ac7db77256987d083a563287b5, CMake bootstrap and property/case exports so this PR can build standalone. Only the 13ucnv_*exports above are introduced by this change. The combined compare against current main also includes #13578's proposed exports; do not attribute all scanner delta to the converter or merge the shared infrastructure twice. Coordinate #13578 first. New upstream CharacterDigits implementations remain authoritative (the branch removes its older duplicate definitions).Scope and limitations:
UCONFIG_NO_FILE_IO=1plusstubdata.cppmeans only compiled-in encodings (including UTF-8 and UTF-16LE) are supported; converter alias tables and.cnvdata are absent.ucnv_setFromUCallBack,ucnv_setToUCallBackanducnv_cbFromUWriteBytesare intentionally still throwing until guest SysV callback bridges can be validated. Native/guest ICU converter object mixing across distinct ICU runtime versions is unsupported. C signatures match the checked ICU headers but PS5 console ABI and ICU release have not been measured; guest ICU 68 names do not establish ICU 78 behavior on hardware.Overlap audit:
python tools/pr_overlap.py --branch feat/libSceIcu-encoding-converter --repo boykopovar/AnyPS5 --jobs 1examined 1,747 open PRs and exited 2 (fail closed) on shared ICU infrastructure, unmergeable old PRs and inherited property/case implementations. Source inspection confirmsucnv_fromUChars,ucnv_resetToUnicodeanducnv_resetFromUnicodein #14340, #14443 and #16605 are still unconditional throwingint(void)stubs, not competing converter implementations; #14144 similarly touches legacy inventory. #16250 and #16605 overlap the stacked #13578 property/case dependency, while #16507 adds script properties and shares the same source/bootstrap. Integration with #16605 is specifically overlapping incmake/Icu.cmake: both branches contain theicu_commonconverter source list, including${ICU_SOURCE_DIR}/common/uenum.cpp, and the dependentcore/libs/prx/libSceIcu/CMakeLists.txtsetup. When either PR merges, the other must preserve the shared single source list and drop duplicated infrastructure hunks while retaining its own exports and tests. These intersections need coordinated merge resolution; the checker did NOT establish blanket nonoverlap for all shared files. No known open PR has a real implementation of these 13ucnv_*exports.Tested
libSceIcu.prxandguest_icu_converter_native_tests.exebuild: PASS;ctest -R '^guest_icu_converter_native$': 1/1 PASS after latest upstream mergedb6c3468.ASAN_OPTIONS=detect_leaks=1:halt_on_error=1 UBSAN_OPTIONS=halt_on_error=1: actuallibSceIcu.prx/guest test build and CTest 1/1 PASS after latest merge.convertEx: PASS.tools/check_conventions.py --base upstream/main --head HEAD: PASS. Branch-scopedgit diff upstream/main...HEAD --check: PASS.maind03beaf110on November 9, 2026, Windows MinGW GCC 15.2 Release rebuilt the ICU native converter, properties, case mapping, UnicodeData and upstream converter-helper tests; CTest 5/5 passed. WSL Ubuntu GCC 13.3 ASan/UBSan built the same five targets and CTest 5/5 passed withASAN_OPTIONS=detect_leaks=0 UBSAN_OPTIONS=halt_on_error=1(leak detection disabled). Conventions againstupstream/mainand diff whitespace checks passed. This merge preserves upstreamConverterHelpers.cppand its regression test alongside the branch's converter and Unicode tests. Updated commitf6b9dc7f4f720387f53e16ecf78a2e49e623efef.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)Pull request closed