feat(libSceCesCs): add the Windows-1253, 1255 and 1257 profiles #9912

Closed
SkillzTech1 wants to merge 1 commit from upstream-pr/9912 into main
SkillzTech1 commented 2026-10-22 21:25:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SkillzTech1 on 2026-10-22T21:25:55Z.


What

Builds on #8923, which adds 27 single-byte profiles and leaves out the Windows code pages whose best-fit tables map bytes to private use. This adds those three: sceCesRefersUcsProfileCp1253, sceCesRefersUcsProfileCp1255 and sceCesRefersUcsProfileCp1257 now return a profile instead of throwing.

  • Tables: the MBTABLE of Microsoft's bestfit1253.txt, bestfit1255.txt and bestfit1257.txt, the same source as CP1250_HIGH, CP1251_HIGH and #8923's 1254, 1256 and 1258. They are three more entries in #8923's SingleByte.hpp, used through its sbcHighTable; no other code changes.
  • Private use bytes: 15 bytes map to the Private Use Area, as the tables give them: Cp1253 0xAA, 0xD2, 0xFF (U+F8F9-U+F8FB), Cp1255 0xD9-0xDF, 0xFB, 0xFC, 0xFF (U+F88D-U+F896) and Cp1257 0xA1, 0xA5 (U+F8FC, U+F8FD). This is what Windows' own conversion does for these code pages. Every other byte, including Cp1255 0xCA (U+05BA), is a regular character or a C1 control as in the other Windows tables.
  • Table properties: in each table bytes 0x00-0x7F map to themselves and the 256 bytes map to 256 different BMP characters, so sceCesUtf8ToSbc and MBCS output are unambiguous.
  • Stacked on #8923: the branch contains #8923's commit 27c3f6ba2; the change here is the last commit only. I will rebase it onto main once #8923 merges.
  • Unverified: the console's handling of the 15 bytes is not known; the "Single-byte profiles" entry in docs/dev/debt/libSceCesCs.md says so, now for 30 profiles. The pending-exports count drops from 222 to 219.

Tested

Windows 11 Pro, MSYS2 UCRT64 GCC 16.1.0, Release, this branch merged into main 9e568a389 (#8923's base no longer configures with this GCC, which needs the SEH support added since).

  • ctest -R '^guest_ces': 6/6 pass (guest_ces, guest_ces_module, guest_ces_dbcs, guest_ces_dbcs_module, guest_ces_unicode, guest_ces_unicode_module). CheckSingleByteProfiles covers the three new profiles: distinct stable pointers, the 1-255 round trip, and four sample bytes each plus two of the private use bytes and Cp1255 0xCA.
  • Outside the repository, a harness linked against the built libSceCesCs.prx decoded all 256 bytes and encoded all BMP scalars for 1250-1258 and compared them with Python 3.13's cp125x codecs: 0 mismatches in both directions; the only bytes not compared are those Python leaves undefined, listed above. Each profile encodes exactly 256 scalars.
  • python3 tools/check_conventions.py --base origin/main passes.

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: #8923
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4974339987 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9912). Originally posted by [SkillzTech1](https://github.com/SkillzTech1) on 2026-10-22T21:25:55Z. --- ### What Builds on #8923, which adds 27 single-byte profiles and leaves out the Windows code pages whose best-fit tables map bytes to private use. This adds those three: `sceCesRefersUcsProfileCp1253`, `sceCesRefersUcsProfileCp1255` and `sceCesRefersUcsProfileCp1257` now return a profile instead of throwing. - **Tables:** the `MBTABLE` of Microsoft's [bestfit1253.txt](https://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WindowsBestFit/bestfit1253.txt), [bestfit1255.txt](https://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WindowsBestFit/bestfit1255.txt) and [bestfit1257.txt](https://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WindowsBestFit/bestfit1257.txt), the same source as `CP1250_HIGH`, `CP1251_HIGH` and #8923's 1254, 1256 and 1258. They are three more entries in #8923's `SingleByte.hpp`, used through its `sbcHighTable`; no other code changes. - **Private use bytes:** 15 bytes map to the Private Use Area, as the tables give them: Cp1253 `0xAA`, `0xD2`, `0xFF` (U+F8F9-U+F8FB), Cp1255 `0xD9`-`0xDF`, `0xFB`, `0xFC`, `0xFF` (U+F88D-U+F896) and Cp1257 `0xA1`, `0xA5` (U+F8FC, U+F8FD). This is what Windows' own conversion does for these code pages. Every other byte, including Cp1255 `0xCA` (U+05BA), is a regular character or a C1 control as in the other Windows tables. - **Table properties:** in each table bytes 0x00-0x7F map to themselves and the 256 bytes map to 256 different BMP characters, so `sceCesUtf8ToSbc` and MBCS output are unambiguous. - **Stacked on #8923:** the branch contains #8923's commit 27c3f6ba2; the change here is the last commit only. I will rebase it onto `main` once #8923 merges. - **Unverified:** the console's handling of the 15 bytes is not known; the "Single-byte profiles" entry in `docs/dev/debt/libSceCesCs.md` says so, now for 30 profiles. The pending-exports count drops from 222 to 219. ### Tested Windows 11 Pro, MSYS2 UCRT64 GCC 16.1.0, Release, this branch merged into `main` 9e568a389 (#8923's base no longer configures with this GCC, which needs the SEH support added since). - `ctest -R '^guest_ces'`: 6/6 pass (`guest_ces`, `guest_ces_module`, `guest_ces_dbcs`, `guest_ces_dbcs_module`, `guest_ces_unicode`, `guest_ces_unicode_module`). `CheckSingleByteProfiles` covers the three new profiles: distinct stable pointers, the 1-255 round trip, and four sample bytes each plus two of the private use bytes and Cp1255 `0xCA`. - Outside the repository, a harness linked against the built `libSceCesCs.prx` decoded all 256 bytes and encoded all BMP scalars for 1250-1258 and compared them with Python 3.13's `cp125x` codecs: 0 mismatches in both directions; the only bytes not compared are those Python leaves undefined, listed above. Each profile encodes exactly 256 scalars. - `python3 tools/check_conventions.py --base origin/main` passes. ### 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: #8923 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)

Pull request closed

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!9912
No description provided.