ces: add the ISO-8859-15 single-byte profile #1323

Closed
opened 2026-11-26 09:53:07 +00:00 by github-bot · 1 comment
Owner

@⁠NevesHenry on GitHub · 2026-10-09 18:50 UTC · original

Summary

Tour de France 2023 (#485, PPSA14198) imports sceCesRefersUcsProfileIso8859_15 (NID NLW0QcvJY-E), which isn't registered. The unresolved-import stub returns 0, so the game gets a null profile. sceCesUtf8ToSbc and sceCesSbcToUtf8 return -1 for a null profile and write no output.

This change registers the function and returns a dedicated profile. When the two single-byte converters receive it, they use ISO-8859-15 instead of CP1252. ISO-8859-15 is Latin-1 with eight bytes reassigned: A4 €, A6 Š, A8 š, B4 Ž, B8 ž, BC Œ, BD œ, BE Ÿ. A character with no byte becomes ?, as in the existing CP1252 path. Every other profile, CP1252 included, converts exactly as before.

The getter has the same shape as sceCesRefersUcsProfileCp1252: no arguments, returns a profile pointer. orbital's IDA type database lists the same prototypes for the getter and both converters (db_types.json).

Evidence

All five logs attached to #485 (builds d96d0ee, 040b2b9 and d285efe) call this stub. It is the only unresolved import that shows up in any of them:

Log Stub calls logged
time attack, d96d0ee 1024 (the logging limit, so at least that many)
team event, d96d0ee 529
team event, 040b2b9 548
team event, d285efe 533
team event, not in game, d285efe 435

The calls come in bursts of up to 101 in a row. Resolved Ces calls aren't logged, so I can't tell which converter the game hands the profile to. I don't have the game, so I can't say whether this changes anything visible. It doesn't touch the two crashes reported in #485 (GDS fill range is out of bounds, unsupported format 16).

Testing

TestIso8859_15Profile in tests/CesTests.cpp round-trips the eight reassigned bytes and three unchanged ones through both converters. It also checks that U+00A4 (¤), which lost its byte, becomes ?, and that the CP1252 profile still maps € to 0x80.

Ubuntu 24.04 container, clang 18, CMake 3.31.6:

  • with this change, ces_tests passes
  • with the function registered but both converters ignoring the profile, ces_tests fails on all eight reassigned bytes and on the U+00A4 check

I also ran both converters with this profile over all 256 bytes and all 1,112,064 Unicode scalar values, and compared the results with Python's iso8859_15 codec, counting characters it can't encode as ?. There were no differences.

ces_tests isn't in the CI build lists, so CI only compiles libCes.cpp. The changed lines are clean under clang-format 22.1.3. Not built on Windows or macOS.

AI assistance

An AI coding assistant (Claude Code) helped me read the #485 logs, look up the function prototypes, write the change and the test, and run the builds above. I reviewed the code and the test results. All communication on this PR comes from me.

🤖 Generated with Claude Code

Pull request details or commits were not available from GitHub; kept as an issue.

**@⁠NevesHenry** on GitHub · 2026-10-09 18:50 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1323) ## Summary Tour de France 2023 (#485, PPSA14198) imports `sceCesRefersUcsProfileIso8859_15` (NID `NLW0QcvJY-E`), which isn't registered. The unresolved-import stub returns 0, so the game gets a null profile. `sceCesUtf8ToSbc` and `sceCesSbcToUtf8` return -1 for a null profile and write no output. This change registers the function and returns a dedicated profile. When the two single-byte converters receive it, they use ISO-8859-15 instead of CP1252. ISO-8859-15 is Latin-1 with eight bytes reassigned: A4 €, A6 Š, A8 š, B4 Ž, B8 ž, BC Œ, BD œ, BE Ÿ. A character with no byte becomes `?`, as in the existing CP1252 path. Every other profile, CP1252 included, converts exactly as before. The getter has the same shape as `sceCesRefersUcsProfileCp1252`: no arguments, returns a profile pointer. orbital's IDA type database lists the same prototypes for the getter and both converters ([db_types.json](https://github.com/AlexAltea/orbital/blob/b321fcdbd700cc02da1cb1ad25412781d5ec73c6/tools/ida/db_types.json#L273)). ## Evidence All five logs attached to #485 (builds d96d0ee, 040b2b9 and d285efe) call this stub. It is the only unresolved import that shows up in any of them: | Log | Stub calls logged | | --- | --- | | time attack, d96d0ee | 1024 (the logging limit, so at least that many) | | team event, d96d0ee | 529 | | team event, 040b2b9 | 548 | | team event, d285efe | 533 | | team event, not in game, d285efe | 435 | The calls come in bursts of up to 101 in a row. Resolved Ces calls aren't logged, so I can't tell which converter the game hands the profile to. I don't have the game, so I can't say whether this changes anything visible. It doesn't touch the two crashes reported in #485 (`GDS fill range is out of bounds`, `unsupported format 16`). ## Testing `TestIso8859_15Profile` in `tests/CesTests.cpp` round-trips the eight reassigned bytes and three unchanged ones through both converters. It also checks that U+00A4 (¤), which lost its byte, becomes `?`, and that the CP1252 profile still maps € to 0x80. Ubuntu 24.04 container, clang 18, CMake 3.31.6: - with this change, `ces_tests` passes - with the function registered but both converters ignoring the profile, `ces_tests` fails on all eight reassigned bytes and on the U+00A4 check I also ran both converters with this profile over all 256 bytes and all 1,112,064 Unicode scalar values, and compared the results with Python's `iso8859_15` codec, counting characters it can't encode as `?`. There were no differences. `ces_tests` isn't in the CI build lists, so CI only compiles `libCes.cpp`. The changed lines are clean under clang-format 22.1.3. Not built on Windows or macOS. ## AI assistance An AI coding assistant (Claude Code) helped me read the #485 logs, look up the function prototypes, write the change and the test, and run the builds above. I reviewed the code and the test results. All communication on this PR comes from me. 🤖 Generated with [Claude Code](https://claude.com/claude-code) *Pull request details or commits were not available from GitHub; kept as an issue.*
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:53:07 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-09 18:52 UTC · original

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e189b5f1-e537-48aa-a15a-c7ee89bffed8

📥 Commits

Reviewing files that changed from the base of the PR and between c1926f915d and 6785ef9bc38f015639c8d00c1a75e5cd27e98155.


📒 Files selected for processing (2)
  • src/libs/libCes.cpp
  • tests/CesTests.cpp

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.



📝 Walkthrough

Walkthrough

Adds an ISO-8859-15 profile alongside CP1252. The conversion functions select the encoding by profile pointer. The ISO-8859-15 mapping handles its eight reassigned bytes and emits ? for displaced Latin-1 characters. Tests cover profile identity, selected round trips, and replacement behavior.

Suggested reviewers: emk530


Priority: ⬇️ Low

Change: Feature

Merge Risk: ⚪ Minimal · up to 6785e

No concrete issue with the new ISO-8859-15 profile remains identified; the change is mergeable after normal checks.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 7.69% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly and concisely identifies the primary change: adding the ISO-8859-15 single-byte profile to ces.
Description check Passed The description is directly related to the changeset. It explains profile registration, ISO-8859-15 conversion behavior, compatibility with CP1252, evidence, and testing.


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

**@⁠coderabbitai[bot]** on GitHub · 2026-10-09 18:52 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1323#issuecomment-6087241254) <!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- review_stack_entry_start --> <a href="https://app.coderabbit.ai/change-stack/KytyPS5/KytyPS5/pull/1323?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&amp;cs_source=review_comment"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui-dark.svg?v=2" alt="Review in Change Stack →" width="220" height="32"></a> <!-- review_stack_entry_end --> <!-- recent_review_start --> No actionable comments were generated in the recent review. 🎉 <details> <summary>ℹ️ Recent review info</summary> <details> <summary>⚙️ Run configuration</summary> - **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `e189b5f1-e537-48aa-a15a-c7ee89bffed8` <hr> </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between c1926f915d2a3f743e1dd482a3b7ff09d750bca6 and 6785ef9bc38f015639c8d00c1a75e5cd27e98155. <hr> </details> <details> <summary>📒 Files selected for processing (2)</summary> * `src/libs/libCes.cpp` * `tests/CesTests.cpp` <hr> </details> **Included review availability:** This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. <hr> </details> --- <!-- recent_review_end --> <!-- walkthrough_start --> <details> <summary>📝 Walkthrough</summary> ## Walkthrough Adds an ISO-8859-15 profile alongside CP1252. The conversion functions select the encoding by profile pointer. The ISO-8859-15 mapping handles its eight reassigned bytes and emits `?` for displaced Latin-1 characters. Tests cover profile identity, selected round trips, and replacement behavior. **Suggested reviewers:** `emk530` <hr> </details> <!-- walkthrough_end --> <!-- change_assessment_start --> **Priority:** ⬇️ Low <!-- change_assessment_commit:"6785ef9bc38f015639c8d00c1a75e5cd27e98155" --> **Change:** Feature <!-- change_assessment_end --> <!-- final_review_risk_start --> **Merge Risk:** **⚪ Minimal** · up to `6785e` <!-- final_review_risk_coverage:{"sourceCommitId":"6785ef9bc38f015639c8d00c1a75e5cd27e98155","coveredCommitId":"6785ef9bc38f015639c8d00c1a75e5cd27e98155","kind":"reviewed"} --> No concrete issue with the new ISO-8859-15 profile remains identified; the change is mergeable after normal checks. <!-- final_review_risk_end --> <!-- pre_merge_checks_walkthrough_start --> <details> <summary>Pre-merge checks | <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v1.svg" width="14" height="17" align="middle" alt="Passed" title="Passed"></picture></sup> 4 | <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-failed-14-v1.svg" width="14" height="17" align="middle" alt="Failed" title="Failed"></picture></sup> 1</summary> ### ❌ Failed checks (1 warning) | Check name | Status | Explanation | Resolution | | :---------------- | :----------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------- | | Docstring Coverage | ![Warning](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-warning.svg) | Docstring coverage is 7.69% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 2 files. | Write docstrings for the functions missing them to satisfy the coverage threshold. | <details> <summary>✅ Passed checks (4 passed)</summary> | Check name | Status | Explanation | | :------------------------ | :--------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Linked Issues check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | Check skipped because no linked issues were found for this pull request. | | Out of Scope Changes check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | Check skipped because no linked issues were found for this pull request. | | Title check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The title clearly and concisely identifies the primary change: adding the ISO-8859-15 single-byte profile to ces. | | Description check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The description is directly related to the changeset. It explains profile registration, ISO-8859-15 conversion behavior, compatibility with CP1252, evidence, and testing. | <hr> </details> <hr> </details> <!-- pre_merge_checks_walkthrough_end --> <!-- autopilot:start --> - [ ] <!-- {"checkboxId":"2708ad07-9f24-4260-9c11-7dc76a49f2e3"} --> <strong title="Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts">Autofix</strong> · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts <!-- autopilot:end --> <!-- tips_start --> --- Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=KytyPS5/KytyPS5&utm_content=1323)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. <details> <summary>❤️ Share</summary> - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code) <hr> </details> <sub>Comment `@coderabbitai help` to get the list of available commands.</sub> <!-- tips_end -->
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/KytyPS5--KytyPS5#1323
No description provided.