fix(libSceCesCs): refuse the Cp1254 and Cp1258 holes and UTF-32 surrogates as a PS5 does #13898
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/13898"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by zaryabzip on 2026-10-31T11:50:53Z.
What
Replaces #13848, which the open-PR limit closed; same branch and head.
Two single-byte conversion answers now match what @rooklz measured on a PS5. That sweep converted every byte through
sceCesSbcToUtf32and every BMP scalar throughsceCesUtf32ToSbc, for every single-byte profile:mainbefore81 8D 8E 8F 90 9D 9E0x805C0020both waysU+0081…)81 8A 8D 8E 8F 90 9A 9D 9E0x805C0020both wayssceCesUtf32ToSbcwith a surrogate, every single-byte profile0x805C0015(ILLEGAL_CODE)0x805C0014(INVALID_ENCODE)@BunnyFl's 13.42 run of the module gives the same Cp1254 and Cp1258 bytes. #10185 already made Cp1250 to 1252 answer this way. The same sweep found the ISO 8859, PC code page and KOI8 tables matching byte for byte, and Cp1256 with no holes.
0xFFFF(unassigned) marker. The reverse lookup then refusesU+0081and the others too.sceCesUtf32ToSbcanswers0x805C0015after its existing profile and destination checks.sceCesUcs2ToSbcand the big- and little-endian UTF-32 forms share the helper but weren't measured, so they keep0x805C0014, andGuestCesWide.cpp'sUcs2ToSbc(0xD800)row is unchanged.No function changes count.
Overlap: #10056 (approved, older) also rewrites the single-byte debt line, which this has to change because it says the holes map to C1. #10056 goes first and I'll rebase this onto it. Rechecked against
main5de1621ff1, which hasn't changed these files since the tested base:git merge-treemerges this cleanly with every other open pull request that merges withmain, including #13573, which edits the debt lines just above.Tests:
GuestCes.cpp'sCheckSingleByteProfilessweep now expects0x805C0020fromsceCesSbcToUtf32andsceCesUtf32ToSbcat those bytes, and the old round trip everywhere else.GuestCesWide.cppaddssceCesUtf32ToSbc(0xD800)with Cp1252 and(0xDFFF)with Cp1254.Tested
Windows 11 (WinLibs MinGW-w64 GCC 15.2.0 UCRT r7, CMake 4.3.1, Ninja 1.13.2) and Ubuntu 24.04 on WSL2 (GCC 13.3.0, CMake 3.28.3, Ninja 1.11.1), both with
5f4b1c401emerged intomaind93ebe62d9. The head3c478fe2a4differs from it only in where the surrogate note sits in the debt file.Export.cpp,SingleByte.hpp,GuestCes.cpporGuestCesWide.cpp.ctest -R guest_ces: 20 of 20 pass on both hosts, the module builds included;guest_cespasses 3 of 3 on--repeat until-fail:3.mainwith only the two test files,guest_cesandguest_ces_moduleabort at the first hole (Cp1254 byte 0x81 decodes to a C1 code point), andguest_ces_wideandguest_ces_wide_moduleat the first surrogate row (0x805C0014), on both hosts (Windows exit 0xc0000409, Linux SIGABRT).tools/check_conventions.pypasses.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T11:53:40Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The implementation and reported tests look sound, but the PR body says #10056 must land first while its required
Depends onchecklist entry saysnone.What I ran
Reviewed head
3c478fe2a4414ce30dccdf0cb3fb856dee0d1d69against PR base5de1621ff13712e8b3a6d70a2487b008d9ee80c3; the fresh preview against currentmainb8f0a6b2025605b78eb70646bda79f458a577c82is clean. Environment: Debian Linux x86_64, Python 3.11.2. No local build or C++ tests were run.Results
ctest -R guest_ces: 20/20 on Windows and WSL2; baseline tests reportedly fail on the prior behavior. Not independently run here.Negative control
Findings
Blocking
The PR description says the open #10056 changes the same
Single-byte profilesdebt entry and must land first, but the template checklist saysDepends on: none. The repository requires this dependency to be declared. Please change the checklist entry toDepends on: #10056. As you state in the PR, wait for #10056 to land before rebasing this debt-file overlap.Non-blocking
None identified in this review.
Sources
Not verified
I did not build or run the C++ tests locally, test a PS5, or independently reproduce the reported Windows/WSL2 tests. The latest hosted Windows job was still in progress.
To get this to a good state
Declare
#10056inDepends on, let it land, then rebase this PR onto the resultingmain. I’ll re-check the updated dependency and rerun the relevant checks on the new head.