feat(libSceIcu): implement six locale parsing and keyword exports #16490

Merged
hyvvs merged 4 commits from upstream-pr/16490 into main 2026-11-10 17:34:05 +00:00
hyvvs commented 2026-11-06 22:03:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hyvvs on 2026-11-06T22:03:01Z.


What

Implements six previously throwing, guest-callable ICU locale C exports: uloc_getLanguage, uloc_getCountry, uloc_getScript, uloc_getBaseName, uloc_canonicalize, and uloc_getKeywordValue.

  • Replaces no-argument placeholder declarations with public ICU-style typed signatures (APS5_VABI, 32-bit lengths/status pointers).
  • Handles ASCII language/script/region case normalization, ordinary variant/encoding parsing, keyword lookup and canonical ordering, and U_BUFFER_OVERFLOW_ERROR/U_STRING_NOT_TERMINATED_WARNING with bounded writes. Existing 66 unimplemented exports in this inventory remain throwing.
  • A new Release-active guest test covers success, preflight, truncation, exact-size buffers, malformed keywords, and error/guard propagation, linked against the actual Windows libSceIcu.prx.
  • No new third-party code, data tables, or submodules. Desktop ICU 74 differential results are evidence for a useful source-compatible subset, not a claim that PS5 firmware's ICU 68 behaves identically for untested locale grammar, CLDR aliases, or console execution. See updated technical debt.

Tested

  • Windows MinGW WinLibs GCC 15.2 Release: configured full repository CMake/Ninja with bundled dependencies; built libSceIcu and guest_icu_locale_core_tests; focused CTest guest_icu_locale_core: 1/1 PASS on the final branch head.
  • Ubuntu WSL GCC with -O1 -g -DNDEBUG -fsanitize=address,undefined, ASAN_OPTIONS=detect_leaks=1:halt_on_error=1, UBSan halt-on-error: PASS for source-linked guest regression, no sanitizer errors.
  • Independent native ICU 74 (libicuuc.so.74) differential: 22,647 input/capacity/keyword cases, zero mismatches on exercised locales, including 600 deterministic synthetic locale combinations. Console/firmware runtime not tested.
  • python core/libs/tests/test_public_headers.py --audit-only: 407 libraries / 30,759 declarations PASS. python -I tools/check_conventions.py --base upstream/main --head HEAD PASS; branch diff whitespace check PASS.

Checklist

  • Based on current main; no other open PR implements the same functions (checked authored/open ICU PRs #14144, #14340, #14443, #13578 and function-name search)
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw; no fake-success replacements
  • No notes, investigation .md files or images added to repository (only library technical debt updated)
  • New third-party code is a submodule built from source (n/a: none added)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a (no GPU code changed)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5195289156 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16490). Originally posted by [hyvvs](https://github.com/hyvvs) on 2026-11-06T22:03:01Z. --- ### What Implements six previously throwing, guest-callable ICU locale C exports: `uloc_getLanguage`, `uloc_getCountry`, `uloc_getScript`, `uloc_getBaseName`, `uloc_canonicalize`, and `uloc_getKeywordValue`. - Replaces no-argument placeholder declarations with public ICU-style typed signatures (`APS5_VABI`, 32-bit lengths/status pointers). - Handles ASCII language/script/region case normalization, ordinary variant/encoding parsing, keyword lookup and canonical ordering, and `U_BUFFER_OVERFLOW_ERROR`/`U_STRING_NOT_TERMINATED_WARNING` with bounded writes. Existing 66 unimplemented exports in this inventory remain throwing. - A new Release-active guest test covers success, preflight, truncation, exact-size buffers, malformed keywords, and error/guard propagation, linked against the actual Windows `libSceIcu.prx`. - No new third-party code, data tables, or submodules. Desktop ICU 74 differential results are evidence for a useful source-compatible subset, **not** a claim that PS5 firmware's ICU 68 behaves identically for untested locale grammar, CLDR aliases, or console execution. See updated technical debt. ### Tested - Windows MinGW WinLibs GCC 15.2 Release: configured full repository CMake/Ninja with bundled dependencies; built `libSceIcu` and `guest_icu_locale_core_tests`; focused CTest `guest_icu_locale_core`: **1/1 PASS** on the final branch head. - Ubuntu WSL GCC with `-O1 -g -DNDEBUG -fsanitize=address,undefined`, `ASAN_OPTIONS=detect_leaks=1:halt_on_error=1`, UBSan halt-on-error: **PASS** for source-linked guest regression, no sanitizer errors. - Independent native ICU 74 (`libicuuc.so.74`) differential: **22,647 input/capacity/keyword cases, zero mismatches** on exercised locales, including 600 deterministic synthetic locale combinations. Console/firmware runtime **not tested**. - `python core/libs/tests/test_public_headers.py --audit-only`: 407 libraries / 30,759 declarations PASS. `python -I tools/check_conventions.py --base upstream/main --head HEAD` PASS; branch diff whitespace check PASS. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions (checked authored/open ICU PRs #14144, #14340, #14443, #13578 and function-name search) - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw; no fake-success replacements - [x] No notes, investigation `.md` files or images added to repository (only library technical debt updated) - [x] New third-party code is a submodule built from source (n/a: none added) - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a (no GPU code changed) - [x] AI-assisted: yes
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!16490
No description provided.