feat(libSceIcu): implement bidi, charset detection, normalization and simple case exports over ICU #16605
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16605"
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 justdoston on 2026-11-07T08:45:35Z.
What
Implements 38 libSceIcu exports that no other open PR touches by forwarding them to ICU 78.1, built from the
3rdparty/icusubmodule that #13578 adds. This PR is stacked on #13578. Because #13578 currently conflicts withmain, the branch includes one merge commit (9e7b8d4553) that mergesmaininto it. That merge keeps main'su_charDigitValue/u_digit(CharacterDigits.cpp) instead of #13578's duplicate wrappers, removes the 47 stubs #13578 implements under their current names, and recounts the debt entries. This PR's own change is the last commit.Bidi.cpp)ubidi_open,ubidi_close,ubidi_setPara,ubidi_getParaLevel,ubidi_countRuns,ubidi_getVisualRun,ubidi_getLogicalRun,ubidi_getBaseDirection,ubidi_reorderVisual,ubidi_setClassCallback,ubidi_getClass(11)CharsetDetection.cpp)ucsdet_open,ucsdet_close,ucsdet_setText,ucsdet_detectAll,ucsdet_getName,ucsdet_getConfidence,ucsdet_enableInputFilter(7)Normalization.cpp)unorm2_getNFCInstance,unorm2_getNFDInstance,unorm2_getInstance(nfconly),unorm2_normalize,unorm2_normalizeSecondAndAppend,unorm2_append,unorm2_getDecomposition,unorm2_getRawDecomposition,unorm2_composePair,unorm2_getCombiningClass,unorm2_isNormalized,unorm2_quickCheck,unorm2_spanQuickCheckYes,unorm2_hasBoundaryBefore,unorm2_hasBoundaryAfter,unorm2_isInert(16)CodePoints.cpp)u_tolower,u_toupper,u_totitle,ublock_getCode(4)std::invalid_argument. Every other input, including failing statuses and invalid arguments ICU reports throughUErrorCode, goes to ICU unchanged.ubidi_setClassCallbackcallback runs through a host adapter with the guest ABI. The previous guest callback and context are reported back, and the adapter state is released inubidi_close.unorm2_getInstancefor other names or packages.unorm2_openFilteredandunorm2_closethrow because guestuset_*sets are not ICU objects. All of these are recorded indocs/dev/debt/libSceIcu.md.cmake/Icu.cmake:ubidi.cpp,ubidiln.cpp,ubidiwrt.cpp,ustr_cnv.cppandustrfmt.cpptoicu_common.uenum.cppout of the Windows-only block.CharsetMatch::getUCharsincsmatch.cpplinks against. That function is not exported; the converters are built so the library resolves every symbol on every platform.icu_i18ntarget with the charset detector sources.u_tolower,u_toupper,u_totitle,ublock_getCodeand sixunorm2_*were bare-named declarations inExport.cpp. They now use the_nid_postfixsuffix, which the NID ignores.Tested
Linux (Ubuntu, GCC), not the full project build. A CMake harness includes the repository's
cmake/Icu.cmakeand builds the four new sources as a shared library linked with--no-undefined, with ASan and UBSan:*_nid_postfixfunctions are exported, with no ICU symbols.guest_icu_bidi,guest_icu_charset_detection,guest_icu_normalizationandguest_icu_code_pointspass with leak detection on. Their expected values come from Unicode data: bidi runs and levels, NFC/NFD of U+00E9, U+1E08 and Hangul, combining classes, UTF-8/UTF-16 BOM detection at confidence 100, simple case mappings and block codes.tools/check_conventions.pyandtest_public_headers.py --audit-onlypass. Windows and macOS were not built locally.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