feat(libSceIcu): resolve a null locale through the default locale #21242

Merged
beardsciences merged 3 commits from upstream-pr/21242 into main 2026-11-16 08:26:28 +00:00
beardsciences commented 2026-11-16 01:23:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by beardsciences on 2026-11-16T01:23:43Z.


What

Twelve implemented libSceIcu exports still throw NotImplemented_nid_no_patch when the locale argument is null: uloc_getLanguage, uloc_getCountry, uloc_getScript, uloc_getVariant, uloc_getBaseName, uloc_canonicalize, uloc_getParent, uloc_getISO3Language, uloc_getISO3Country, uloc_isRightToLeft, u_strToLower and u_strToUpper. In ICU a null locale names the default locale, and passing null is the usual way to ask for the system's language, region or case rules. #20642 adds uloc_getDefault; this PR completes these exports on top of it.

  • Each export now replaces a null locale with uloc_getDefault() at the point where ICU 68.2 does, after its own status check, and then runs its existing code: uloc_getLanguage, uloc_getScript, uloc_getCountry, uloc_getVariant, _canonicalize for uloc_getBaseName and uloc_canonicalize, uloc_getParent, uloc_getISO3Language and uloc_getISO3Country, uloc_isRightToLeft through uloc_getScript, and ustrcase_getCaseLocale for the two case mappers. A failed status still returns before the locale is read.
  • CaseMapping.cpp, LocaleSyntax.cpp and RightToLeft.cpp include the bundled ICU's headers, whose renaming macros would turn uloc_getDefault into the bundled ICU's own (the host's default locale). They call Icu::DefaultLocaleName() instead, a one-line helper in LocaleCore.cpp, which includes no ICU header, around this module's uloc_getDefault.
  • Not changed: ICU also replaces the ID i-default with the default locale in uloc_getBaseName and uloc_canonicalize; that still needs the rest of ICU's canonicalizer and stays recorded in the debt entry.
  • Debt: the pending fragments feat-libSceIcu-locale-iso-codes.md and libSceIcu-locale-syntax.md already change or add the entries that described these throws, and tools/debt_fold.py refuses a second fragment on one entry, so this PR edits their text. The new fragment feat-icu-null-locale-default.md updates the right-to-left and case-mapping entries.

Tested

Windows 11 26200, WinLibs GCC 15.2.0, Release, Ryzen 5 5600X. Built and run at the head 1476512d23 on main 98a39e8e05.

  • New guest_icu_null_locale_{turkish,arabic,long}: three guest environments (LANG=tr_TR.UTF-8@traditional, LC_ALL=ar_Arab_EG.UTF-8 over LANG=fr_FR, and an over-long language that gives the empty default name). For all twelve exports, null gives exactly what the default locale's own name gives, and the expected values hold: tr/TR/TRADITIONAL/tr_TR/tur/TUR, Turkish dotted and dotless i from u_strToUpper and u_strToLower (root mapping for ""), Arab and right-to-left for the Arabic default, and empty answers for the empty default. A failed status leaves a null locale unread.
  • Existing tests that asserted the throws (guest_icu_locale_core, guest_icu_locale_syntax, guest_icu_right_to_left) now assert the same rule: null answers as the default locale does.
  • ctest -R '^public_headers|^guest_icu': 122 of 122 pass.
  • Removal checks: 11 mutations, each making one site use the root locale for null, the helper return a fixed locale, or the case mappers ignore the locale. All 11 make a test fail; the restored build passes.
  • python tools/check_conventions.py --base origin/main with this title and description: passed, with one warning: the existing 1786-character LocaleCore.cpp entry in #20996's fragment, which this PR does not change. python tools/debt_fold.py --check: passed.

Not run: Linux, macOS, a console, any title.

Overlap

  • Depends on #20642 (the default locale). Until it merges, this branch carries it as one merge commit, so the diff here includes #20642's code: the change of this PR is the last commit, 1476512d23. The repository merges with merge commits, so the diff shrinks to that commit once #20642 is on main.
  • #18557 (uloc_getName, uloc_openKeywords) and #18210 (u_strToTitle) add new exports that throw for a null locale in the same way; once they and this PR land, they can use Icu::DefaultLocaleName() too. Neither changes the functions this PR completes.
  • #21177 changes the status-pointer handling of uloc_getVariant in LocaleSyntax.cpp, next to the one line this PR changes there; whichever lands second needs a one-line rebase.
  • Edits the pending debt fragments of #20996 and of the locale-syntax PR, both merged, as described above.

Checklist

  • Based on current main; no other open PR implements the same functions (see Overlap)
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: #20642
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes (Claude Code)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5329402748 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/21242). Originally posted by [beardsciences](https://github.com/beardsciences) on 2026-11-16T01:23:43Z. --- ### What Twelve implemented libSceIcu exports still throw `NotImplemented_nid_no_patch` when the locale argument is null: `uloc_getLanguage`, `uloc_getCountry`, `uloc_getScript`, `uloc_getVariant`, `uloc_getBaseName`, `uloc_canonicalize`, `uloc_getParent`, `uloc_getISO3Language`, `uloc_getISO3Country`, `uloc_isRightToLeft`, `u_strToLower` and `u_strToUpper`. In ICU a null locale names the default locale, and passing null is the usual way to ask for the system's language, region or case rules. #20642 adds `uloc_getDefault`; this PR completes these exports on top of it. - Each export now replaces a null locale with `uloc_getDefault()` at the point where ICU 68.2 does, after its own status check, and then runs its existing code: [`uloc_getLanguage`, `uloc_getScript`, `uloc_getCountry`, `uloc_getVariant`](https://github.com/unicode-org/icu/blob/84e1f26ea77152936e70d53178a816dbfbf69989/icu4c/source/common/uloc.cpp#L1684-L1690), `_canonicalize` for `uloc_getBaseName` and `uloc_canonicalize`, [`uloc_getParent`](https://github.com/unicode-org/icu/blob/84e1f26ea77152936e70d53178a816dbfbf69989/icu4c/source/common/uloc.cpp#L1642-L1674), [`uloc_getISO3Language` and `uloc_getISO3Country`](https://github.com/unicode-org/icu/blob/84e1f26ea77152936e70d53178a816dbfbf69989/icu4c/source/common/uloc.cpp#L1945-L1980), [`uloc_isRightToLeft`](https://github.com/unicode-org/icu/blob/84e1f26ea77152936e70d53178a816dbfbf69989/icu4c/source/common/loclikely.cpp) through `uloc_getScript`, and [`ustrcase_getCaseLocale`](https://github.com/unicode-org/icu/blob/84e1f26ea77152936e70d53178a816dbfbf69989/icu4c/source/common/ustrcase_locale.cpp) for the two case mappers. A failed status still returns before the locale is read. - `CaseMapping.cpp`, `LocaleSyntax.cpp` and `RightToLeft.cpp` include the bundled ICU's headers, whose renaming macros would turn `uloc_getDefault` into the bundled ICU's own (the host's default locale). They call `Icu::DefaultLocaleName()` instead, a one-line helper in `LocaleCore.cpp`, which includes no ICU header, around this module's `uloc_getDefault`. - Not changed: ICU also replaces the ID `i-default` with the default locale in `uloc_getBaseName` and `uloc_canonicalize`; that still needs the rest of ICU's canonicalizer and stays recorded in the debt entry. - Debt: the pending fragments `feat-libSceIcu-locale-iso-codes.md` and `libSceIcu-locale-syntax.md` already change or add the entries that described these throws, and `tools/debt_fold.py` refuses a second fragment on one entry, so this PR edits their text. The new fragment `feat-icu-null-locale-default.md` updates the right-to-left and case-mapping entries. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Windows 11 26200, WinLibs GCC 15.2.0, Release, Ryzen 5 5600X. Built and run at the head `1476512d23` on `main` `98a39e8e05`. - New `guest_icu_null_locale_{turkish,arabic,long}`: three guest environments (`LANG=tr_TR.UTF-8@traditional`, `LC_ALL=ar_Arab_EG.UTF-8` over `LANG=fr_FR`, and an over-long language that gives the empty default name). For all twelve exports, null gives exactly what the default locale's own name gives, and the expected values hold: `tr`/`TR`/`TRADITIONAL`/`tr_TR`/`tur`/`TUR`, Turkish dotted and dotless i from `u_strToUpper` and `u_strToLower` (root mapping for `""`), `Arab` and right-to-left for the Arabic default, and empty answers for the empty default. A failed status leaves a null locale unread. - Existing tests that asserted the throws (`guest_icu_locale_core`, `guest_icu_locale_syntax`, `guest_icu_right_to_left`) now assert the same rule: null answers as the default locale does. - `ctest -R '^public_headers|^guest_icu'`: 122 of 122 pass. - Removal checks: 11 mutations, each making one site use the root locale for null, the helper return a fixed locale, or the case mappers ignore the locale. All 11 make a test fail; the restored build passes. - `python tools/check_conventions.py --base origin/main` with this title and description: passed, with one warning: the existing 1786-character `LocaleCore.cpp` entry in #20996's fragment, which this PR does not change. `python tools/debt_fold.py --check`: passed. Not run: Linux, macOS, a console, any title. ### Overlap - Depends on #20642 (the default locale). Until it merges, this branch carries it as one merge commit, so the diff here includes #20642's code: the change of this PR is the last commit, `1476512d23`. The repository merges with merge commits, so the diff shrinks to that commit once #20642 is on `main`. - #18557 (`uloc_getName`, `uloc_openKeywords`) and #18210 (`u_strToTitle`) add new exports that throw for a null locale in the same way; once they and this PR land, they can use `Icu::DefaultLocaleName()` too. Neither changes the functions this PR completes. - #21177 changes the status-pointer handling of `uloc_getVariant` in `LocaleSyntax.cpp`, next to the one line this PR changes there; whichever lands second needs a one-line rebase. - Edits the pending debt fragments of #20996 and of the locale-syntax PR, both merged, as described above. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions (see Overlap) - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) and the licence notice of code adapted from upstream (see AGENTS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: #20642 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes (Claude Code)
PrivacyOnion commented 2026-11-16 01:35:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-16T01:35:50Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 1476512d23:

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: guest_icu_default_locale_tests, guest_icu_locale_core_tests, guest_icu_locale_syntax_tests, guest_icu_null_locale_tests, guest_icu_right_to_left_tests built cleanly.
  • CTest (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_locale_core, guest_icu_null_locale_turkish, guest_icu_null_locale_arabic, guest_icu_null_locale_long, guest_icu_locale_syntax, guest_icu_right_to_left):
    1/11 Test #3565: guest_icu_default_locale_posix ......   Passed    0.05 sec
    2/11 Test #3566: guest_icu_default_locale_messages ...   Passed    0.06 sec
    3/11 Test #3567: guest_icu_default_locale_codeset ....   Passed    0.05 sec
    4/11 Test #3568: guest_icu_default_locale_nynorsk ....   Passed    0.06 sec
    5/11 Test #3569: guest_icu_default_locale_long .......   Passed    0.04 sec
    6/11 Test #3603: guest_icu_null_locale_turkish .......   Passed    0.05 sec
    7/11 Test #3572: guest_icu_locale_core ...............   Passed    0.08 sec
    8/11 Test #3604: guest_icu_null_locale_arabic ........   Passed    0.04 sec
    9/11 Test #3605: guest_icu_null_locale_long ..........   Passed    0.05 sec
    10/11 Test #3613: guest_icu_locale_syntax .............   Passed    0.04 sec
    11/11 Test #3619: guest_icu_right_to_left .............   Passed    0.04 sec
    100% tests passed, 0 tests failed out of 11
    
  • Negative control: with core/libs/prx/libSceIcu/CaseMapping.cpp, core/libs/prx/libSceIcu/Export.cpp, core/libs/prx/libSceIcu/LegacyExports.cpp, core/libs/prx/libSceIcu/LocaleCore.cpp, core/libs/prx/libSceIcu/LocaleSyntax.cpp, core/libs/prx/libSceIcu/RightToLeft.cpp, core/libs/prx/libSceIcu/include/InventoryExports.hpp, core/libs/prx/libSceIcu/include/LegacyExports.hpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified CaseMapping.cpp (MapInLocale) resolves nullptr locale via Icu::DefaultLocaleName() after status reference setup and delegates empty default locale names to UCASE_LOC_ROOT before calling ustrcase_mapWithOverlap.
    • Verified DefaultLocale.cpp implements uprv_getDefaultLocaleID_nid_postfix, uloc_getDefault, and uloc_setDefault_nid_postfix with POSIX environment fallback, variant/codeset normalization, length cap (< 12), and mutex-protected persistent storage in DefaultNames().
    • Verified LocaleCore.cpp and LocaleSyntax.cpp resolve nullptr locale via Icu::DefaultLocaleName() only after checking status (!status || *status > 0) and before buffer capacity validation, matching ICU 68.2 semantics.
    • Verified Export.cpp and LegacyExports.cpp remove the obsolete NotImplemented_nid_no_patch stubs for uloc_getDefault, uprv_getDefaultLocaleID_nid_postfix, and uloc_setDefault_nid_postfix without leaving duplicate symbols.
    • Verified all build and CTest suites (including guest_icu_default_locale_, guest_icu_null_locale_, guest_icu_locale_core, guest_icu_locale_syntax, and guest_icu_right_to_left) compile and pass, and check_conventions.py passed.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5914099407 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/21242#pullrequestreview-5914099407). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-16T01:35:50Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `1476512d23`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **Build**: `guest_icu_default_locale_tests`, `guest_icu_locale_core_tests`, `guest_icu_locale_syntax_tests`, `guest_icu_null_locale_tests`, `guest_icu_right_to_left_tests` built cleanly. - **CTest** (`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_locale_core`, `guest_icu_null_locale_turkish`, `guest_icu_null_locale_arabic`, `guest_icu_null_locale_long`, `guest_icu_locale_syntax`, `guest_icu_right_to_left`): ``` 1/11 Test #3565: guest_icu_default_locale_posix ...... Passed 0.05 sec 2/11 Test #3566: guest_icu_default_locale_messages ... Passed 0.06 sec 3/11 Test #3567: guest_icu_default_locale_codeset .... Passed 0.05 sec 4/11 Test #3568: guest_icu_default_locale_nynorsk .... Passed 0.06 sec 5/11 Test #3569: guest_icu_default_locale_long ....... Passed 0.04 sec 6/11 Test #3603: guest_icu_null_locale_turkish ....... Passed 0.05 sec 7/11 Test #3572: guest_icu_locale_core ............... Passed 0.08 sec 8/11 Test #3604: guest_icu_null_locale_arabic ........ Passed 0.04 sec 9/11 Test #3605: guest_icu_null_locale_long .......... Passed 0.05 sec 10/11 Test #3613: guest_icu_locale_syntax ............. Passed 0.04 sec 11/11 Test #3619: guest_icu_right_to_left ............. Passed 0.04 sec 100% tests passed, 0 tests failed out of 11 ``` - **Negative control**: with `core/libs/prx/libSceIcu/CaseMapping.cpp`, `core/libs/prx/libSceIcu/Export.cpp`, `core/libs/prx/libSceIcu/LegacyExports.cpp`, `core/libs/prx/libSceIcu/LocaleCore.cpp`, `core/libs/prx/libSceIcu/LocaleSyntax.cpp`, `core/libs/prx/libSceIcu/RightToLeft.cpp`, `core/libs/prx/libSceIcu/include/InventoryExports.hpp`, `core/libs/prx/libSceIcu/include/LegacyExports.hpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Verified CaseMapping.cpp (MapInLocale) resolves nullptr locale via Icu::DefaultLocaleName() after status reference setup and delegates empty default locale names to UCASE_LOC_ROOT before calling ustrcase_mapWithOverlap. - Verified DefaultLocale.cpp implements uprv_getDefaultLocaleID_nid_postfix, uloc_getDefault, and uloc_setDefault_nid_postfix with POSIX environment fallback, variant/codeset normalization, length cap (< 12), and mutex-protected persistent storage in DefaultNames(). - Verified LocaleCore.cpp and LocaleSyntax.cpp resolve nullptr locale via Icu::DefaultLocaleName() only after checking status (!status || *status > 0) and before buffer capacity validation, matching ICU 68.2 semantics. - Verified Export.cpp and LegacyExports.cpp remove the obsolete NotImplemented_nid_no_patch stubs for uloc_getDefault, uprv_getDefaultLocaleID_nid_postfix, and uloc_setDefault_nid_postfix without leaving duplicate symbols. - Verified all build and CTest suites (including guest_icu_default_locale_*, guest_icu_null_locale_*, guest_icu_locale_core, guest_icu_locale_syntax, and guest_icu_right_to_left) compile and pass, and check_conventions.py passed. Looks Good To Me
PrivacyOnion commented 2026-11-16 02:08:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-16T02:08:02Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against f2e21c7a05:

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: guest_icu_locale_core_tests, guest_icu_locale_syntax_tests, guest_icu_null_locale_tests, guest_icu_right_to_left_tests built cleanly.
  • CTest (guest_icu_locale_core, guest_icu_null_locale_turkish, guest_icu_null_locale_arabic, guest_icu_null_locale_long, guest_icu_locale_syntax, guest_icu_right_to_left):
    1/6 Test #3613: guest_icu_locale_syntax ..........   Passed    0.01 sec
    2/6 Test #3619: guest_icu_right_to_left ..........   Passed    0.02 sec
    3/6 Test #3603: guest_icu_null_locale_turkish ....   Passed    0.01 sec
    4/6 Test #3572: guest_icu_locale_core ............   Passed    0.02 sec
    5/6 Test #3604: guest_icu_null_locale_arabic .....   Passed    0.01 sec
    6/6 Test #3605: guest_icu_null_locale_long .......   Passed    0.01 sec
    100% tests passed, 0 tests failed out of 6
    
  • Negative control: with core/libs/prx/libSceIcu/CaseMapping.cpp, core/libs/prx/libSceIcu/LocaleCore.cpp, core/libs/prx/libSceIcu/LocaleSyntax.cpp, core/libs/prx/libSceIcu/RightToLeft.cpp reverted to main and the new tests kept, the suite fails:
    1/6 Test #3613: guest_icu_locale_syntax ..........Subprocess aborted***Exception:   0.42 sec
    2/6 Test #3603: guest_icu_null_locale_turkish ....Subprocess aborted***Exception:   0.47 sec
    3/6 Test #3572: guest_icu_locale_core ............Subprocess aborted***Exception:   0.50 sec
    4/6 Test #3605: guest_icu_null_locale_long .......Subprocess aborted***Exception:   0.67 sec
    5/6 Test #3619: guest_icu_right_to_left ..........   Passed    0.13 sec
    6/6 Test #3604: guest_icu_null_locale_arabic .....Subprocess aborted***Exception:   1.79 sec
    17% tests passed, 5 tests failed out of 6
    
    Restoring the change makes it pass again.
  • Code reading:
    • Verified CaseMapping.cpp (MapInLocale) checks status via Status(error) before resolving nullptr locale through Icu::DefaultLocaleName(), then delegates to ucase_getCaseLocale or UCASE_LOC_ROOT and ustrcase_mapWithOverlap, matching ICU ustrcase_getCaseLocale semantics.
    • Verified LocaleCore.cpp (Component for uloc_getLanguage/uloc_getCountry/uloc_getScript, uloc_getBaseName, uloc_canonicalize, uloc_getParent) checks !status || *status > 0 before resolving nullptr locale via Icu::DefaultLocaleName(), and uloc_getISO3Language / uloc_getISO3Country resolve nullptr before Parse(locale).
    • Verified LocaleSyntax.cpp (uloc_getVariant_nid_postfix) checks incoming status via ReadStatus(status, func) and returns early on incoming > 0 before resolving nullptr locale via Icu::DefaultLocaleName() and validating destination buffer capacity.
    • Verified RightToLeft.cpp (uloc_isRightToLeft_nid_postfix) resolves nullptr locale via Icu::DefaultLocaleName() before LanguageAndScript(locale).
    • Verified CMakeLists.txt adds guest_icu_null_locale_tests covering turkish, arabic, and long default locale scenarios, and technical debt fragments in docs/dev/debt/changes/ accurately document the updated null-locale behavior.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5914267421 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/21242#pullrequestreview-5914267421). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-16T02:08:02Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `f2e21c7a05`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **Build**: `guest_icu_locale_core_tests`, `guest_icu_locale_syntax_tests`, `guest_icu_null_locale_tests`, `guest_icu_right_to_left_tests` built cleanly. - **CTest** (`guest_icu_locale_core`, `guest_icu_null_locale_turkish`, `guest_icu_null_locale_arabic`, `guest_icu_null_locale_long`, `guest_icu_locale_syntax`, `guest_icu_right_to_left`): ``` 1/6 Test #3613: guest_icu_locale_syntax .......... Passed 0.01 sec 2/6 Test #3619: guest_icu_right_to_left .......... Passed 0.02 sec 3/6 Test #3603: guest_icu_null_locale_turkish .... Passed 0.01 sec 4/6 Test #3572: guest_icu_locale_core ............ Passed 0.02 sec 5/6 Test #3604: guest_icu_null_locale_arabic ..... Passed 0.01 sec 6/6 Test #3605: guest_icu_null_locale_long ....... Passed 0.01 sec 100% tests passed, 0 tests failed out of 6 ``` - **Negative control**: with `core/libs/prx/libSceIcu/CaseMapping.cpp`, `core/libs/prx/libSceIcu/LocaleCore.cpp`, `core/libs/prx/libSceIcu/LocaleSyntax.cpp`, `core/libs/prx/libSceIcu/RightToLeft.cpp` reverted to `main` and the new tests kept, the suite fails: ``` 1/6 Test #3613: guest_icu_locale_syntax ..........Subprocess aborted***Exception: 0.42 sec 2/6 Test #3603: guest_icu_null_locale_turkish ....Subprocess aborted***Exception: 0.47 sec 3/6 Test #3572: guest_icu_locale_core ............Subprocess aborted***Exception: 0.50 sec 4/6 Test #3605: guest_icu_null_locale_long .......Subprocess aborted***Exception: 0.67 sec 5/6 Test #3619: guest_icu_right_to_left .......... Passed 0.13 sec 6/6 Test #3604: guest_icu_null_locale_arabic .....Subprocess aborted***Exception: 1.79 sec 17% tests passed, 5 tests failed out of 6 ``` Restoring the change makes it pass again. - **Code reading**: - Verified CaseMapping.cpp (MapInLocale) checks status via Status(error) before resolving nullptr locale through Icu::DefaultLocaleName(), then delegates to ucase_getCaseLocale or UCASE_LOC_ROOT and ustrcase_mapWithOverlap, matching ICU ustrcase_getCaseLocale semantics. - Verified LocaleCore.cpp (Component for uloc_getLanguage/uloc_getCountry/uloc_getScript, uloc_getBaseName, uloc_canonicalize, uloc_getParent) checks !status || *status > 0 before resolving nullptr locale via Icu::DefaultLocaleName(), and uloc_getISO3Language / uloc_getISO3Country resolve nullptr before Parse(locale). - Verified LocaleSyntax.cpp (uloc_getVariant_nid_postfix) checks incoming status via ReadStatus(status, __func__) and returns early on incoming > 0 before resolving nullptr locale via Icu::DefaultLocaleName() and validating destination buffer capacity. - Verified RightToLeft.cpp (uloc_isRightToLeft_nid_postfix) resolves nullptr locale via Icu::DefaultLocaleName() before LanguageAndScript(locale). - Verified CMakeLists.txt adds guest_icu_null_locale_tests covering turkish, arabic, and long default locale scenarios, and technical debt fragments in docs/dev/debt/changes/ accurately document the updated null-locale behavior. Looks Good To Me
MarcZX10 commented 2026-11-16 02:17:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T02:17:28Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this change; the inspected implementation and reported checks support merging.

What I ran

Reviewed head f2e21c7a056923bc34b6da39a3477dc7d0b37085 using repo_read.py-backed review tools. No commands or tests were run in this review. The author reports 122 of 122 guest/header tests passing and 11 removal mutations caught; those results were not independently run here.

Results

Check Result Note
Diff and changed files passed All 13 changed files inspected
Tests in this review not run Author-reported results only
Console and other OS behavior not run Not independently confirmed

Findings

Blocking

None.

Non-blocking

None.

Not verified

Build and test output, including the reported removal checks, was not independently verified. Linux, macOS, console behavior, and title compatibility were not run or confirmed. The reviewed files were core/libs/prx/libSceIcu/CMakeLists.txt, core/libs/prx/libSceIcu/CaseMapping.cpp, core/libs/prx/libSceIcu/DefaultLocaleName.hpp, core/libs/prx/libSceIcu/LocaleCore.cpp, core/libs/prx/libSceIcu/LocaleSyntax.cpp, core/libs/prx/libSceIcu/RightToLeft.cpp, core/libs/prx/libSceIcu/tests/NullLocale.cpp, core/libs/prx/libSceIcu/tests/RightToLeft.cpp, core/libs/tests/GuestIcuLocaleCore.cpp, core/libs/tests/GuestIcuLocaleSyntax.cpp, docs/dev/debt/changes/feat-icu-null-locale-default.md, docs/dev/debt/changes/feat-libSceIcu-locale-iso-codes.md, and docs/dev/debt/changes/libSceIcu-locale-syntax.md. No changed files were excluded by the review manifest.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5914316047 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/21242#pullrequestreview-5914316047). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-16T02:17:28Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this change; the inspected implementation and reported checks support merging. ## What I ran Reviewed head `f2e21c7a056923bc34b6da39a3477dc7d0b37085` using `repo_read.py`-backed review tools. No commands or tests were run in this review. The author reports 122 of 122 guest/header tests passing and 11 removal mutations caught; those results were not independently run here. ## Results | Check | Result | Note | |---|---|---| | Diff and changed files | passed | All 13 changed files inspected | | Tests in this review | not run | Author-reported results only | | Console and other OS behavior | not run | Not independently confirmed | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified Build and test output, including the reported removal checks, was not independently verified. Linux, macOS, console behavior, and title compatibility were not run or confirmed. The reviewed files were `core/libs/prx/libSceIcu/CMakeLists.txt`, `core/libs/prx/libSceIcu/CaseMapping.cpp`, `core/libs/prx/libSceIcu/DefaultLocaleName.hpp`, `core/libs/prx/libSceIcu/LocaleCore.cpp`, `core/libs/prx/libSceIcu/LocaleSyntax.cpp`, `core/libs/prx/libSceIcu/RightToLeft.cpp`, `core/libs/prx/libSceIcu/tests/NullLocale.cpp`, `core/libs/prx/libSceIcu/tests/RightToLeft.cpp`, `core/libs/tests/GuestIcuLocaleCore.cpp`, `core/libs/tests/GuestIcuLocaleSyntax.cpp`, `docs/dev/debt/changes/feat-icu-null-locale-default.md`, `docs/dev/debt/changes/feat-libSceIcu-locale-iso-codes.md`, and `docs/dev/debt/changes/libSceIcu-locale-syntax.md`. No changed files were excluded by the review manifest. ## To get this to a good state Nothing is required.
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!21242
No description provided.