feat(libSceIcu): implement locale_getKeywordsStart #14050
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14050"
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 danielhorngt on 2026-10-31T17:06:05Z.
What
Implements
locale_getKeywordsStart(NIDwlK146pHnQ4, in the PS5 3.20 inventory), which was a throwing stub. It returns a pointer to the first@of a locale ID, or null when there is none. A null locale, which ICU dereferences, throws.The signature needed evidence, because ICU changed it. ICU 65.1, 68.2 and 76.1 take
const char*; ICU 77.1 and the 78.1 commit pinned in the debt notes takestd::string_view. Firmware 3.20's module is ICU 68:tools-style NID hashing of_ZN6icu_6813BreakIterator23createCharacterInstanceERKNS_6LocaleER10UErrorCodegivesBufsAiaX0+s, a 3.20 inventory NID, and theicu_65spelling does not match. So this usesconst char*and follows ICU 68.2uloc.cpp. The EBCDIC branch there does not apply. The debt entry records that the ICU version of later firmware is unverified.The stub counts in
docs/dev/debt/libSceIcu.mdgo from 93 to 92 and from 73 to 72.Tested
Windows 11 Pro, i9-12900K, WinLibs GCC 15.2.0 r7, full build tree. No title or console was used.
ctest -R '^guest_icu_': all 9 passed, including the newguest_icu_locale.ctest -R '^(public_headers|conventions_wrapped_declarations)$': passed.guest_icu_localechecks the exact returned pointer: first@of several,@first and last, bytes above 0x7f, no@, an empty string, a@after the terminator, 64 KiB strings, and a null locale throwingstd::invalid_argument.strchrwithstrrchrmadeguest_icu_localefail. That edit was reverted.python tools/check_conventions.py --base upstream/mainpassed.python tools/pr_overlap.py --branch feat/icu-locale-keywords-startexited 2. It lists #11115, #11118, #11122, #11132, #11136, #12320, #12738 and #13578, which shareCMakeLists.txtand the debt file, and for #12320 and #13578Export.cpp. None of their diffs nameslocale_getKeywordsStart, so any conflict is at the ends of those shared files, not the same function.Not run: the full test suite, the
libstarget, Linux, macOS, or the relinker on a module that imports this function.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
Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-11-02T01:58:54Z.
Review: APPROVED
Windows 11, WinLibs GCC 15.2.0 r7, Release. Head
c0bf834527merged into upstream/main93dbd0f82a:guest_icu_*tests pass, including the newguest_icu_locale.std::strchrchanged tostd::strrchr,guest_icu_localefails (locale "en@a=b@c=d": expected offset 2, got 6).tools/check_conventions.py --base upstream/main --head c0bf834527: passes.I recomputed the version argument independently.
_ZN6icu_6813BreakIterator23createCharacterInstanceERKNS_6LocaleER10UErrorCodehashes toBufsAiaX0+s, which main already exports from libSceIcu, while theicu_65spelling givesEfNWIZF8McY. Andlocale_getKeywordsStarthashes towlK146pHnQ4. So ICU 68'sconst char*signature and itsuprv_strchr(localeID, '@')body are the right reference.