feat(libSceIcu): implement uloc_forLanguageTag #16872
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16872"
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 ashwin280802 on 2026-11-07T19:29:44Z.
What
Implements
uloc_forLanguageTagin libSceIcu, following ICU 68.2 uloc_tag.cpp. It parses a BCP 47 tag into an ICU locale ID, reports the parsed length and the status, and keeps ICU's_POSIXsuffix after the variants when a non-uextension or private use follows a variant (ICU 74 no longer writes it).A
-u-extension with a key throws throughNotImplemented_nid_no_patch: ICU maps keys and types through thekeyTypeDataresource, which no host library provides. This and the missing console comparison are recorded indocs/dev/debt/libSceIcu.md.uloc_toLanguageTagis not part of this change.Open PR overlap: PR 16507 and PR 16611 also edit
core/libs/prx/libSceIcu/CMakeLists.txtnear line 12 (source list, no shared export). The overlap check could not compare 9 other open PRs that conflict withmain(10964, 10965, 10966, 10967, 12738, 13578, 14123, 14212, 16250), so I make no claim of zero overlap with them.Tested
Windows 11, MinGW GCC (WinLibs) build in
build-full, commit 8c8105ea0c.ctest --test-dir build-full -R guest_icu, including the newguest_icu_language_tag:I changed 20 conditions one at a time and the new test failed on all 20.
python3 tools/check_conventions.py --base origin/main:Not covered by a test: the
-u-keyword mapping (not implemented; the throw is tested), and agreement with a console.Not verified: behaviour on a console. The wider libSceIcu and NKWebKit run (65 tests, Windows and Linux in Docker, all passed) ran on commit d80cd25375, not on this commit; the commits after it change only the technical debt file, so the code and tests are identical.
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 gabichuuuuu on 2026-11-07T22:07:10Z.
Review: COMMENTED
Read
4ef6d81f0cagainstmain.I compared
LanguageTag.cppwith ICU 68.2uloc_tag.cpp(ultag_parse,_appendKeywords,_appendLDMLExtensionAsKeywords,uloc_forLanguageTag): the legacy and redundant tables and their order (zh-min-nanbeforezh-min), the subtag state machine,lvarianthandling, the parsed-length delta (i-defaultgives 9,cel-gaulish11), the 100-byte attribute limit, ICU 68's_POSIXrule (en-fonipa-t-abgivesen__FONIPA_POSIX@t=ab), and the overflow, not-terminated and negative-capacity results. They match; I found no defect. Throwing for-u-keys before anything is written, and for null arguments, fits the project rules, and the new test can't pass onmain, where the stub has no parameters and throws.One thing outside the code: the PR follows ICU 68.2 deliberately, while other entries in the same debt file follow ICU 78.1, which firmware 13.42 reports. The debt entry already records that, and which one titles see is a firmware question, not a defect here.
Not run here; this is from reading the code.
AI-assisted: yes.