feat(libSceCesCs): add sceCesRefersUcsProfileCp1251 and sceCesMbcsUcsContextInit #3824

Merged
xXPBSXx merged 3 commits from upstream-pr/3824 into main 2026-10-12 08:36:23 +00:00
xXPBSXx commented 2026-10-11 17:16:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-11T17:16:05Z.


What

Adds sceCesRefersUcsProfileCp1251 and sceCesMbcsUcsContextInit to libSceCesCs, which PPSA15246 imports.

  • sceCesRefersUcsProfileCp1251 returns a profile that sceCesSbcToUtf8 and sceCesUtf8ToSbc accept next to the existing Cp1252 one, with the Windows-1251 table of Microsoft's bestfit1251.txt (byte 0x98, unassigned there, maps to U+0098 like the unassigned Cp1252 bytes; the console behavior for that byte is not verified).
  • sceCesMbcsUcsContextInit(context, profile) returns the invalid-parameter error for a null context and success otherwise without writing to the context: its layout and size are unknown. The signature follows the Orbital IDA type database. Listed in docs/dev/TechnicalDebt.md.

guest_ces_tests gets a Cp1251 round-trip case.

Tested

Windows, main a11c8f7f7 plus this branch: python tools/check_conventions.py --base upstream/main passes; ctest -R guest_ces passes. Not tested on Linux and not run against PPSA15246 with this branch; no conversion through an initialized context exists.

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 in TechnicalDebt
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4820860114 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3824). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-11T17:16:05Z. --- ### What Adds `sceCesRefersUcsProfileCp1251` and `sceCesMbcsUcsContextInit` to `libSceCesCs`, which PPSA15246 imports. - `sceCesRefersUcsProfileCp1251` returns a profile that `sceCesSbcToUtf8` and `sceCesUtf8ToSbc` accept next to the existing Cp1252 one, with the Windows-1251 table of Microsoft's bestfit1251.txt (byte 0x98, unassigned there, maps to U+0098 like the unassigned Cp1252 bytes; the console behavior for that byte is not verified). - `sceCesMbcsUcsContextInit(context, profile)` returns the invalid-parameter error for a null context and success otherwise without writing to the context: its layout and size are unknown. The signature follows the Orbital IDA type database. Listed in `docs/dev/TechnicalDebt.md`. `guest_ces_tests` gets a Cp1251 round-trip case. ### Tested Windows, `main` a11c8f7f7 plus this branch: `python tools/check_conventions.py --base upstream/main` passes; `ctest -R guest_ces` passes. Not tested on Linux and not run against PPSA15246 with this branch; no conversion through an initialized context exists. ### 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 - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in TechnicalDebt - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source (none added) - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-11 17:16:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T17:16:26Z.


Progress report (bab7b32 → 50ca599)

📈 System libraries: 86.48% (+0.01%, +2 implemented functions)

✅ 2 implemented
Library Name
libSceCesCs sceCesMbcsUcsContextInit
libSceCesCs sceCesRefersUcsProfileCp1251
⚪ 1 behaviourally empty (constant return or throw)
Library Name
libSceCesCs sceCesRefersUcsProfileCp1251
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6111598777 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3824#issuecomment-6111598777). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-11T17:16:26Z. --- <!-- progress-report --> ### Progress report (bab7b32 → 50ca599) 📈 **System libraries**: 86.48% (+0.01%, +2 implemented functions) <details> <summary>✅ 2 implemented</summary> | Library | Name | | - | - | | libSceCesCs | `sceCesMbcsUcsContextInit` | | libSceCesCs | `sceCesRefersUcsProfileCp1251` | </details> <details> <summary>⚪ 1 behaviourally empty (constant return or throw)</summary> | Library | Name | | - | - | | libSceCesCs | `sceCesRefersUcsProfileCp1251` | </details>
adriadam10 commented 2026-10-11 17:54:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T17:54:25Z.

Review: CHANGES_REQUESTED


Thanks, the Cp1251 table and the profile handling check out (all 128 entries match the Windows-1251 codec; guest_ces passes on a Linux build and fails to link without the change). Two things to fix:

  • core/libs/prx/libSceCesCs-module/CMakeLists.txt: the only -module targets on main are libSceFont-module and libSceFontFt-module, which exist because a title loads the library under that name. Please show that PPSA15246 (or another title) loads libSceCesCs-module, with a test that uses the target, or drop it from this PR. As is, it compiles the same exports a second time and nothing builds or tests it (EXCLUDE_FROM_ALL).
  • docs/dev/TechnicalDebt.md:47: the new line is the last one of "Silent stubs", where other open PRs append (#2850 already touches the neighbouring line, so this will conflict). Please place it a few lines away from the end of the section.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5484315937 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3824#pullrequestreview-5484315937). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T17:54:25Z. **Review:** CHANGES_REQUESTED --- Thanks, the Cp1251 table and the profile handling check out (all 128 entries match the Windows-1251 codec; `guest_ces` passes on a Linux build and fails to link without the change). Two things to fix: - `core/libs/prx/libSceCesCs-module/CMakeLists.txt`: the only `-module` targets on `main` are `libSceFont-module` and `libSceFontFt-module`, which exist because a title loads the library under that name. Please show that PPSA15246 (or another title) loads `libSceCesCs-module`, with a test that uses the target, or drop it from this PR. As is, it compiles the same exports a second time and nothing builds or tests it (`EXCLUDE_FROM_ALL`). - `docs/dev/TechnicalDebt.md:47`: the new line is the last one of "Silent stubs", where other open PRs append (#2850 already touches the neighbouring line, so this will conflict). Please place it a few lines away from the end of the section.
xXPBSXx commented 2026-10-11 18:35:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-11T18:35:36Z.


Thanks, both points addressed in the new commit on this branch:

  • libSceCesCs-module is removed. I have no evidence that a title loads the library under that name (PPSA15246's sce_module folder holds only libc.prx), and nothing built or tested the target, so it does not belong here.
  • The sceCesMbcsUcsContextInit / Cp1251 TechnicalDebt line moved a few lines up inside "Silent stubs", away from the last line.

Tested: check_conventions.py --base upstream/main passes, ctest -R guest_ces passes (Windows).

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6112321974 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3824#issuecomment-6112321974). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-11T18:35:36Z. --- Thanks, both points addressed in the new commit on this branch: - `libSceCesCs-module` is removed. I have no evidence that a title loads the library under that name (PPSA15246's `sce_module` folder holds only `libc.prx`), and nothing built or tested the target, so it does not belong here. - The `sceCesMbcsUcsContextInit` / Cp1251 TechnicalDebt line moved a few lines up inside "Silent stubs", away from the last line. Tested: `check_conventions.py --base upstream/main` passes, `ctest -R guest_ces` passes (Windows). AI-assisted (Claude Code).
adriadam10 commented 2026-10-11 22:07:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T22:07:40Z.

Review: APPROVED


Checked the Cp1251 table (128 entries), both profiles in sceCesSbcToUtf8/sceCesUtf8ToSbc, guest_ces (passes; fails to link without the change) and the TechnicalDebt placement; both review points are addressed. Merging.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5485205788 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3824#pullrequestreview-5485205788). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T22:07:40Z. **Review:** APPROVED --- Checked the Cp1251 table (128 entries), both profiles in `sceCesSbcToUtf8`/`sceCesUtf8ToSbc`, `guest_ces` (passes; fails to link without the change) and the TechnicalDebt placement; both review points are addressed. Merging.
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!3824
No description provided.