feat(libSceCesCs): add UTF-16 and UTF-32 forms of the SBC and MBCS string conversions #8972

Merged
simonbronk merged 2 commits from upstream-pr/8972 into main 2026-10-23 10:06:54 +00:00
simonbronk commented 2026-10-21 07:55:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-21T07:55:00Z.


What

Implements 22 libSceCesCs exports that were pending stubs: the UTF-16 and UTF-32 forms of converters that existed only for UTF-8.

  • sceCesSbcTo{Ucs2,Utf16,Utf16be,Utf16le,Utf32,Utf32be,Utf32le}
  • sceCes{Ucs2,Utf16,Utf16be,Utf16le,Utf32,Utf32be,Utf32le}ToSbc
  • sceCesMbcsStrTo{Utf16,Utf32}Str, sceCesMbcsStrGet{Utf16,Utf32}Len
  • sceCes{Utf16,Utf32}StrToMbcsStr, sceCes{Utf16,Utf32}StrGetMbcsLen

Signatures follow the Orbital type database. The single-byte forms copy the argument checks and error order of sceCesSbcToUtf8 and sceCesUtf8ToSbc, and the string forms reuse the existing toMbcs/fromMbcs paths with the CP1252, CP1251, CP1250, CP932 and CP51932 profiles. The errors are not console measurements and are recorded in docs/dev/debt/libSceCesCs.md. libSceCesCs goes from 64 to 86 of 284 in tools/progress.py.

This branch is stacked on #8967 and reuses its UTF-16 decoder and byte-order helpers; only the top commit is new.

Tested

macOS 27 (Apple silicon), clang, C++20: libSceCesCs sources and tests compiled outside CMake, since the full build does not run on macOS. Passing:

  • new guest_ces_wide: errors, byte orders, a round trip of all 256 CP1251 bytes through UTF-32, and UTF-16/UTF-32 strings with the Shift-JIS and CP1252 profiles;
  • existing guest_ces, guest_ces_unicode and guest_ces_japanese (from #8967), with no regressions.

The CMake/ctest build on Linux and Windows was not run locally. check_conventions.py is clean. pr_overlap.py lists only shared files: #8923 (debt file line), #7884 (EUC-KR/UHC/Big5, different exports) and #6044 (test CMake layout), none of which implements these functions. No title tested.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • 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: #8967
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4948290434 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8972). Originally posted by [simonbronk](https://github.com/simonbronk) on 2026-10-21T07:55:00Z. --- ### What Implements 22 libSceCesCs exports that were pending stubs: the UTF-16 and UTF-32 forms of converters that existed only for UTF-8. - `sceCesSbcTo{Ucs2,Utf16,Utf16be,Utf16le,Utf32,Utf32be,Utf32le}` - `sceCes{Ucs2,Utf16,Utf16be,Utf16le,Utf32,Utf32be,Utf32le}ToSbc` - `sceCesMbcsStrTo{Utf16,Utf32}Str`, `sceCesMbcsStrGet{Utf16,Utf32}Len` - `sceCes{Utf16,Utf32}StrToMbcsStr`, `sceCes{Utf16,Utf32}StrGetMbcsLen` Signatures follow the Orbital type database. The single-byte forms copy the argument checks and error order of `sceCesSbcToUtf8` and `sceCesUtf8ToSbc`, and the string forms reuse the existing `toMbcs`/`fromMbcs` paths with the CP1252, CP1251, CP1250, CP932 and CP51932 profiles. The errors are not console measurements and are recorded in `docs/dev/debt/libSceCesCs.md`. libSceCesCs goes from 64 to 86 of 284 in `tools/progress.py`. This branch is stacked on #8967 and reuses its UTF-16 decoder and byte-order helpers; only the top commit is new. ### Tested macOS 27 (Apple silicon), clang, C++20: libSceCesCs sources and tests compiled outside CMake, since the full build does not run on macOS. Passing: - new `guest_ces_wide`: errors, byte orders, a round trip of all 256 CP1251 bytes through UTF-32, and UTF-16/UTF-32 strings with the Shift-JIS and CP1252 profiles; - existing `guest_ces`, `guest_ces_unicode` and `guest_ces_japanese` (from #8967), with no regressions. The CMake/ctest build on Linux and Windows was not run locally. `check_conventions.py` is clean. `pr_overlap.py` lists only shared files: #8923 (debt file line), #7884 (EUC-KR/UHC/Big5, different exports) and #6044 (test CMake layout), none of which implements these functions. No title tested. ### 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 - [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) - [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: #8967 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
ycbuzi commented 2026-10-21 08:28:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ycbuzi on 2026-10-21T08:28:21Z.


Windows run of 5cb8b45110 merged cleanly onto main f894ba69d3, the CMake/ctest build the description lists as not run. The head carries #8967's commit too. Windows 11 Home 10.0.26200, MinGW-w64 GCC 15.2.0 (ucrt-posix-seh r7), Release, BUILD_TESTING=ON.

Built libSceCesCs, its module form and the eight test executables with no errors or warnings. ctest --repeat until-fail:2 on guest_ces, guest_ces_module, guest_ces_unicode, guest_ces_unicode_module, guest_ces_japanese, guest_ces_japanese_module, guest_ces_wide and guest_ces_wide_module: all eight pass on both repeats, the new guest_ces_wide and its module form among them. Not run: Linux, a title.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6311562769 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8972#issuecomment-6311562769). Originally posted by [ycbuzi](https://github.com/ycbuzi) on 2026-10-21T08:28:21Z. --- Windows run of 5cb8b45110 merged cleanly onto `main` f894ba69d3, the CMake/ctest build the description lists as not run. The head carries #8967's commit too. Windows 11 Home 10.0.26200, MinGW-w64 GCC 15.2.0 (ucrt-posix-seh r7), Release, `BUILD_TESTING=ON`. Built `libSceCesCs`, its module form and the eight test executables with no errors or warnings. `ctest --repeat until-fail:2` on `guest_ces`, `guest_ces_module`, `guest_ces_unicode`, `guest_ces_unicode_module`, `guest_ces_japanese`, `guest_ces_japanese_module`, `guest_ces_wide` and `guest_ces_wide_module`: all eight pass on both repeats, the new `guest_ces_wide` and its module form among them. Not run: Linux, a title.
simonbronk commented 2026-10-21 18:16:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-21T18:16:55Z.


Linux run of 79fe0b903 merged onto main 99844c7ee (clean merge).

Environment: Ubuntu 24.04 x86-64 container under Rosetta on Apple Silicon (Colima), GCC 13, RelWithDebInfo, BUILD_TESTING=ON, ANYPS5_ENABLE_ASAN=ON. ASan builds dynamic executables, so this is not the CI configuration.

Results: the full build has no errors. guest_ces, guest_ces_dbcs, guest_ces_japanese, guest_ces_unicode, guest_ces_wide and their module forms: all pass, with no AddressSanitizer report.

Not run: the static CI configuration, native x86-64 hardware, GPU tests, a title.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6323252602 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8972#issuecomment-6323252602). Originally posted by [simonbronk](https://github.com/simonbronk) on 2026-10-21T18:16:55Z. --- Linux run of 79fe0b903 merged onto `main` 99844c7ee (clean merge). **Environment:** Ubuntu 24.04 x86-64 container under Rosetta on Apple Silicon (Colima), GCC 13, `RelWithDebInfo`, `BUILD_TESTING=ON`, `ANYPS5_ENABLE_ASAN=ON`. ASan builds dynamic executables, so this is not the CI configuration. **Results:** the full build has no errors. `guest_ces`, `guest_ces_dbcs`, `guest_ces_japanese`, `guest_ces_unicode`, `guest_ces_wide` and their module forms: all pass, with no AddressSanitizer report. **Not run:** the static CI configuration, native x86-64 hardware, GPU tests, a title. AI-assisted (Claude Code).
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!8972
No description provided.