feat(libSceIcu): resolve i-default through the default locale #21964
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/21964"
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 sarveshgamers on 2026-11-16T23:30:03Z.
What
uloc_getBaseNameanduloc_canonicalizereplace thei-defaultlocale ID, with any subtags after it, by the default locale, as ICU 78.1's_canonicalizedoes (uloc.cpp). Both parse the default first: the base name takes the input's POSIX charset when present, and the canonical ID takes the input's keywords when present and otherwise keeps the default's, so a default set withuloc_setDefaultcannot leak its keywords into the base name, duplicate them in the canonical ID, or add a second charset suffix.SetSystemDefaultcanonicalizes a system ID that is itself ani-defaultID through the same non-recursive canonicalization, so resolving the sentinel cannot recurse andLANG=i-defaultandLANG=i-default-...keepmain's canonical names.The new behavior is exercised by
guest_icu_locale_coreand by fourguest_icu_default_localescenarios, includingLANG=i-defaultandLANG=i-default-extrato cover the recursion guard, and defaults with keywords and a charset.Tested
Windows 11, WinLibs MinGW-w64 GCC 16.2.0 (SEH). The changed sources pass
g++ -fsyntax-only; a focused host harness reproduced the three review cases and theLANG=i-default,LANG=i-default-extraandLANG=i-default_USsystem defaults with the expected names. The fullctestsuite was not run in this workspace because the third-party submodules are not checked out; the PR's CI jobs run it.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)Summary by CodeRabbit
Bug Fixes
i-defaultlocale ID. Locale name lookups now resolve it using the configured default locale while preserving relevant subtags, charset suffixes, and keywords.i-defaultform continue to be handled as regular locale IDs.Documentation
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-16T23:31:19Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
498fca489c:tools/check_conventions.pypassed.guest_icu_default_locale_tests,guest_icu_locale_core_testsbuilt cleanly.guest_icu_default_locale_posix,guest_icu_default_locale_messages,guest_icu_default_locale_codeset,guest_icu_default_locale_nynorsk,guest_icu_default_locale_long,guest_icu_default_locale_i-default,guest_icu_default_locale_i-default-system,guest_icu_locale_core):core/libs/prx/libSceIcu/DefaultLocale.cpp,core/libs/prx/libSceIcu/DefaultLocaleName.hpp,core/libs/prx/libSceIcu/LocaleCore.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T07:44:50Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the review covers all changed files in the manifest, and the available evidence supports merging.
What I ran
Reviewed head
d1c74cd42902a873ff9896bfabee56446bcfe34dusing the prepared description, commit list, manifest, diff, and the pinned repository reader. No tests or builds were run; the Windows test run in the description is author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Sources
Reviewed
core/libs/prx/libSceIcu/CMakeLists.txt,core/libs/prx/libSceIcu/DefaultLocale.cpp,core/libs/prx/libSceIcu/DefaultLocaleName.hpp,core/libs/prx/libSceIcu/LocaleCore.cpp,core/libs/prx/libSceIcu/tests/DefaultLocale.cpp,core/libs/tests/GuestIcuLocaleCore.cpp, anddocs/dev/debt/changes/feat-libSceIcu-locale-iso-codes.mdat the pinned head.Not verified
Build and test results stated in the PR description, behavior on a physical console, and console comparison remain unverified.
review/files.jsonwas not available through the reader; changed-file coverage was checked againstreview/manifest.jsonand the review folder listing.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-26T21:27:32Z.
Review: COMMENTED
Reviewed — no blocking findings
The reviewed code shows no verified blocking defect; I could not run the reported tests or confirm behavior on console hardware.
What I ran
Reviewed head
15108f39a0873954c3a807aab96726d42cc95128. I inspected the prepared diff and manifest, plus relevant changed code and context; no commands or tests were run.Results
Findings
Blocking
None.
Non-blocking
None.
Sources
Reviewed code at the pinned head, including the changed locale handling and tests.
Not verified
Tests and console behavior were not verified. Read the prepared description, commits, manifest, and diff, and the changed files
core/libs/prx/libSceIcu/CMakeLists.txt,core/libs/prx/libSceIcu/DefaultLocale.cpp,core/libs/prx/libSceIcu/DefaultLocaleName.hpp,core/libs/prx/libSceIcu/LocaleCore.cpp,core/libs/prx/libSceIcu/tests/DefaultLocale.cpp,core/libs/tests/GuestIcuLocaleCore.cpp, anddocs/dev/debt/changes/feat-libSceIcu-locale-iso-codes.md. ForLocaleCore.cppand the CMake file, I read the changed hunks and targeted context rather than the entire files. The manifest lists all seven changed files as included; none were excluded by its rules.To get this to a good state
Nothing is required. Optionally, run the reported test command on this head and complete the planned console comparison.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T17:51:42Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the review supports merging, and the points below are optional.
What I ran
Reviewed head
a45ef80cf705b102b23f0ec86e2386340910c76dfrom the prepared diff and source at the pinned head. I did not run commands or tests.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Tests and console behavior were not run or independently confirmed. Read all seven changed files listed in the manifest, including each added line. The review folder’s
files.jsonwas not available through the reader; the manifest lists all changed files as included. No changed files were excluded in the manifest.To get this to a good state
Nothing is required.