fix(libSceCesCs): refuse the Cp1254 and Cp1258 holes and UTF-32 surrogates as a PS5 does #13848
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/13848"
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-31T09:26:07Z.
What
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.
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)Pull request closed