feat(libSceCesCs): add the code page 864 profile #11614

Merged
noamroger merged 4 commits from upstream-pr/11614 into main 2026-11-05 00:33:45 +00:00
noamroger commented 2026-10-26 22:50:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by noamroger on 2026-10-26T22:50:28Z.


What

Implements sceCesRefersUcsProfileCp864, a pending export, with Microsoft's CP864.TXT table. Byte 0x25 is the Arabic percent sign U+066A, and U+0025 has no byte. The undefined bytes 0x9B, 0x9C, 0x9F, 0xA6, 0xA7 and 0xFF are 0 in the table, so they answer UNASSIGNED_CODE in both directions through the existing sbcToUnicode check.

To support the 0x25 mapping, the single-byte lookup gains a small low-byte override table (SingleByte::LOW), which sbcToUnicode and unicodeToSbc consult first. The declaration in include/Api.hpp gets the real return type, the stub leaves PendingExports.cpp (60 left), and a debt entry states what is not measured.

Tested

Linux x86-64, full build with GCC 13. ctest -R guest_ces: all 14 CesCs tests pass. GuestCes.cpp checks every Cp864 byte (the 6 undefined ones fail, the other 249 round-trip and 0x01-0x7F except 0x25 stay ASCII), U+066A ↔ 0x25, U+0025 unassigned, and decoding/encoding through an MBCS context. The table matches Python's cp864 codec byte for byte. tools/check_conventions.py --base origin/main passes. Not tested on a PS5.

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: none (textual overlap only with #10056, #10430 and #10431 in SingleByte.hpp/Export.cpp/PendingExports.cpp, and with the debt file of #10426, #10428 and #10751; no shared exports. Happy to go after them and rebase.)
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5025831658 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11614). Originally posted by [noamroger](https://github.com/noamroger) on 2026-10-26T22:50:28Z. --- ### What Implements `sceCesRefersUcsProfileCp864`, a pending export, with Microsoft's CP864.TXT table. Byte 0x25 is the Arabic percent sign U+066A, and U+0025 has no byte. The undefined bytes 0x9B, 0x9C, 0x9F, 0xA6, 0xA7 and 0xFF are 0 in the table, so they answer `UNASSIGNED_CODE` in both directions through the existing `sbcToUnicode` check. To support the 0x25 mapping, the single-byte lookup gains a small low-byte override table (`SingleByte::LOW`), which `sbcToUnicode` and `unicodeToSbc` consult first. The declaration in `include/Api.hpp` gets the real return type, the stub leaves `PendingExports.cpp` (60 left), and a debt entry states what is not measured. ### Tested Linux x86-64, full build with GCC 13. `ctest -R guest_ces`: all 14 CesCs tests pass. `GuestCes.cpp` checks every Cp864 byte (the 6 undefined ones fail, the other 249 round-trip and 0x01-0x7F except 0x25 stay ASCII), U+066A ↔ 0x25, U+0025 unassigned, and decoding/encoding through an MBCS context. The table matches Python's `cp864` codec byte for byte. `tools/check_conventions.py --base origin/main` passes. Not tested on a PS5. ### Checklist - [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: none (textual overlap only with #10056, #10430 and #10431 in SingleByte.hpp/Export.cpp/PendingExports.cpp, and with the debt file of #10426, #10428 and #10751; no shared exports. Happy to go after them and rebase.) - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-10-26 23:03:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T23:03:50Z.

Review: APPROVED


Reviewed head 2d0f7e214c72883c1b4e4c66b1f39232c4ef853c. The CP864 profile is registered as a distinct single-byte profile, its byte 0x25 override is consulted in both directions, and the undefined 0x0000 table cells flow through the existing unassigned-code handling. The pending export is removed and the API declaration now has the profile-pointer return type. The added MBCS checks cover the special low-byte mapping, representative high-byte mappings, undefined bytes, and round-trip conversion. The PR reports a full Python cp864 table comparison and 14 passing guest_ces tests; I did not rerun them locally. Hosted eligibility, conventions, intake, labels and progress report pass; the build/relinker jobs are skipped by path policy, so no hosted C++ test run is available. I found no blocking issue in the diff.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5660256800 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11614#pullrequestreview-5660256800). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-26T23:03:50Z. **Review:** APPROVED --- Reviewed head `2d0f7e214c72883c1b4e4c66b1f39232c4ef853c`. The CP864 profile is registered as a distinct single-byte profile, its byte `0x25` override is consulted in both directions, and the undefined `0x0000` table cells flow through the existing unassigned-code handling. The pending export is removed and the API declaration now has the profile-pointer return type. The added MBCS checks cover the special low-byte mapping, representative high-byte mappings, undefined bytes, and round-trip conversion. The PR reports a full Python `cp864` table comparison and 14 passing `guest_ces` tests; I did not rerun them locally. Hosted eligibility, conventions, intake, labels and progress report pass; the build/relinker jobs are skipped by path policy, so no hosted C++ test run is available. I found no blocking issue in the diff.
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!11614
No description provided.