feat(libSceIcu): implement the default locale #20642
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/20642"
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 benjaminmathias on 2026-11-15T11:37:36Z.
What
Implements the default locale of libSceIcu:
uprv_getDefaultLocaleID,uloc_getDefaultanduloc_setDefault, following the POSIX branch of ICU 68.2putil.cppandlocale_set_default_internalinlocid.cpp. The system ID comes from the guestsetlocale(LC_MESSAGES, NULL), thenLC_ALL,LC_MESSAGESandLANGin the guest environment, and is corrected as ICU does: the codeset is dropped,C/POSIXbecomeen_US_POSIX,@variantis appended (nynorskgivesNY). It is read once.uloc_getDefaultcanonicalizes it with this module'suloc_canonicalize. A language field of 12 characters or more gives the empty name of a bogusLocale. Each default name stays valid after the default changes.uloc_setDefault(NULL)resets to the system default. A non-null ID throwsNotImplemented_nid_no_patch, because ICU resolves it throughuloc_getName, which this module does not implement yet. The default the console returns is not measured; the debt entry records this.Tested
Windows 11 Pro, WinLibs GCC 15.2.0, full build with
BUILD_TESTING=ON:guest_icu_default_locale_{posix,messages,codeset,nynorsk,long}: 5/5 passed (empty guest environment,LC_MESSAGESoverLANGwith a codeset and a variant,LC_ALL=C.UTF-8,no@nynorsk, an over-long language);ctest -R "^guest_icu_": 52/52 passed.Not tested on Linux or macOS.
DefaultLocale.cppand the libc sources it calls (StdioExtras.cpp,Environment.cpp) are built outside anyWIN32block.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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-15T13:39:33Z.
Review: APPROVED
Reviewed — looks good
The locale implementation and its focused tests are consistent with the stated POSIX behavior, and the inspected changes support merging.
What I ran
Reviewed head
c802434e3eb8b57867c2a04dd0045a75153533e6using the prepared patch andrepo_read.py. No checks were run here; the Windows test results below are author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Did not run the build or tests. Linux and macOS behavior, console locale selection, and the measured PS5 default locale were not verified. All changed files listed in the manifest were read or inspected through the patch:
core/libs/prx/libSceIcu/CMakeLists.txt,core/libs/prx/libSceIcu/DefaultLocale.cpp,core/libs/prx/libSceIcu/Export.cpp,core/libs/prx/libSceIcu/LegacyExports.cpp,core/libs/prx/libSceIcu/include/InventoryExports.hpp,core/libs/prx/libSceIcu/include/LegacyExports.hpp,core/libs/prx/libSceIcu/tests/DefaultLocale.cpp, anddocs/dev/debt/changes/feat-libSceIcu-default-locale.md. No exclusions were reported in the manifest.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-15T21:24:24Z.
Review: COMMENTED
Reviewed — no blocking findings
The reviewed change has no verified blocking defect; the console locale behavior remains unconfirmed, so a formal approval is not justified.
What I ran
Reviewed head
101faed024f5c14a07c9a374c1bdb5682bd162db. I read the prepared description, commits, manifest, and complete patch; I did not run commands or tests. The Windows test results are author-reported. No files were excluded in the manifest.Results
Findings
Blocking
None.
Non-blocking
LC_MESSAGEScategory are modeled after ICU's POSIX path, but the debt entry says the console build's path, category value, and environment have not been confirmed. Compare the returned system locale with the console when that behavior can be measured.Sources
core/libs/prx/libSceIcu/DefaultLocale.cpp.core/libs/prx/libSceIcu/tests/DefaultLocale.cpp.docs/dev/debt/changes/feat-libSceIcu-default-locale.md.Not verified
No build or tests were run in this review. Linux, macOS, and physical-console behavior were not verified. The changed files were
core/libs/prx/libSceIcu/CMakeLists.txt,core/libs/prx/libSceIcu/DefaultLocale.cpp,core/libs/prx/libSceIcu/Export.cpp,core/libs/prx/libSceIcu/LegacyExports.cpp,core/libs/prx/libSceIcu/include/InventoryExports.hpp,core/libs/prx/libSceIcu/include/LegacyExports.hpp,core/libs/prx/libSceIcu/tests/DefaultLocale.cpp, anddocs/dev/debt/changes/feat-libSceIcu-default-locale.md. I read the complete new implementation, tests, CMake additions, inventory declarations, and debt entry; for the large export files I inspected the relevant patch hunks and surrounding portions, not their entire contents. No manifest-excluded files were listed.To get this to a good state
Nothing is required. Optional: compare the system locale behavior with a console build when available.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T01:07:39Z.
Review: COMMENTED
Reviewed — comments
The change adds default locale lookup and reset behavior at the stated head; I found one compatibility concern to share, and the console locale behavior remains unverified.
What I ran
Reviewed head
d53f4471c756792fcd7adc6d0788b3e430ccf086. No commands or tests were run; I inspected the prepared diff and source through the pinned reader. The author reports five new Windows scenarios and 52 guest ICU tests passed; those results were not run by this review.Results
Findings
Blocking
None.
Non-blocking
uloc_setDefault(nullptr, status)appears to re-canonicalize the system locale on each reset, while the implemented system default itself is cached. ICU’s reset path returns to its established system default. Consider caching the canonicalized system default as well, so resets remain consistent if locale state changes through another path. Changed line:core/libs/prx/libSceIcu/DefaultLocale.cpp:127.Not verified
The actual console default locale and whether the console follows this POSIX branch were not verified. Linux and macOS builds were not run. No checks were run in this review. All changed files marked reviewed in the manifest were read:
core/libs/prx/libSceIcu/CMakeLists.txt,core/libs/prx/libSceIcu/DefaultLocale.cpp,core/libs/prx/libSceIcu/Export.cpp,core/libs/prx/libSceIcu/LegacyExports.cpp,core/libs/prx/libSceIcu/include/InventoryExports.hpp,core/libs/prx/libSceIcu/include/LegacyExports.hpp,core/libs/prx/libSceIcu/tests/DefaultLocale.cpp, anddocs/dev/debt/changes/feat-libSceIcu-default-locale.md. No files were excluded by the prepared review folder.To get this to a good state
Nothing is required. Optional: preserve the cached canonical system default when resetting the current default.