feat(libSceCesCs): add the ISO 646 national variants and JIS X 0201 profiles #10430
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10430"
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 rooklz on 2026-10-24T00:04:44Z.
What
Twelve single-byte profile getters that still threw now return profiles:
sceCesRefersUcsProfileAscii,AsciiWithKatakana,Bs4730,GbT1988,GbT1988Tilde0x7e,JisX0201,JisX0201Katakana,JisX0201Roman,JisX0201RomanTilde0x7e,JisX0201Tilde0x7e,KsX1003andKsX1003Tilde0x7e. They work with every existing single-byte scalar converter (sceCesSbcTo*,sceCes*ToSbc) and with the MBCS string and length functions throughsceCesMbcsUcsContextInit, as the 27 profiles of #8923 do.The tables are measured on a PS5. A homebrew payload that loads the console's
libSceCesCs.sprxcalledsceCesSbcToUtf32on every byte andsceCesUtf32ToSbcon every BMP scalar for these twelve profiles and the 30 already onmain, and each of the twelve now hashes the same as the console's sweep (guest_ces_iso646pins the hashes). On the console:CES_ERROR_INVALID_ENCODEfor bytes0x80-0xFF, notUNASSIGNED_CODE.0x23(£);0x7Estays a tilde. GB 1988-80 puts ¥ at0x24, JIS X 0201 Roman ¥ at0x5C, KS X 1003 ₩ at0x5C, and the base GB, JIS and KS sets put an overline at0x7E, which theTilde0x7evariants keep as~. A reassigned ASCII character has no byte.0x21-0x5Fare U+FF61-U+FF9F and0x60-0x7Eare unassigned; the 8-bit profiles (JisX0201,JisX0201Tilde0x7e,AsciiWithKatakana) carry the katakana at0xA1-0xDF.SingleByte.hppgains a two-entry low-half override list per table, anUnassignedmarker (0xFFFF) for bytes a set does not define, and a 7-bit flag;sbcToUnicodereports an unassigned byte and the converters answerINVALID_ENCODEfor a high byte of a 7-bit set.Getter signatures follow the Orbital type database. The other single-byte forms (
sceCesSbcToUtf8,ToUcs2, the string functions) share the tables and were not measured separately. The same sweep found the surrogate answer0x805C0015for every single-byte profile and the C1 holes of Cp1254 and Cp1258 onmain; those are other changes (#10183 has the Cp125x ones).Tested
209cbf758f(verify run on my fork; Ubuntu 24.04, GCC, Release, lavapipe): everyguest_ces*test passes; its failures (agc_driver_sgpr_pattern_fill_keys) aremain's on that runner. macOS (Apple clang 21, x86-64): everyguest_ces*source passes against thisExport.cpp, and a harness built from it matches the console dump for every input above.guest_ces_iso646(new, in both link variants): every byte of every new profile decodes to the expected character or answersCES_ERROR_UNASSIGNED_CODEthroughsceCesSbcToUtf8,sceCesSbcToUcs2andsceCesSbcToUtf32, and encodes back throughsceCesUtf8ToSbc,sceCesUcs2ToSbcandsceCesUtf32ToSbc; the reassigned positions refuse their ASCII character (sceCesUtf32ToSbc(0x5C, JisX0201Roman)is unassigned,0x00A5gives0x5C); the 63 katakana round-trip toU+FF61-U+FF9F; theTilde0x7evariants keep~and refuseU+203E; the fourteen profiles are distinct pointers; and an MBCS context on JIS X 0201 converts5C B6 41 7Eto¥カA‾and back and reports0xE0as unassigned.guest_ces,guest_ces_unicodeandguest_ces_mbcstill pass, so the 27 earlier profiles and CP1252 are unchanged.guest_ces_iso646,guest_ces_iso646_module,guest_ces,guest_ces_module,guest_ces_mbcandguest_ces_unicodepass, each binary run directly with its exit status checked.guest_ces*tests, the two new ones included; the Linux full build (Ubuntu 24.04, GCC, Release, lavapipe) compiles everything and passes everyguest_ces*test, its two failures beingagc_driver_queued_index_read_orderandagc_driver_sgpr_pattern_fill_keys, whichmainfails on that runner. An earlier run on38445f98db, the same code without the WindowsPATHentry for the new test, passed the Linux full build with everyguest_ces*test green andagc_driver_sgpr_pattern_fill_keysas its only failure, whichmainfails on that runner; its Windows job could not loadlibSceCesCs.dllfor the new test, which is why the entry is there.check_conventions.pypasses.pr_overlap.pyreports #10056, #10183, #10185 and #10186 on thesbcToUnicodelines and #10214 and #9912 on theSingleByte.hpptable list; none implements these twelve profiles (#9912 and #10214 add CP1253/1255/1257 and CP858, #10056 eight sparse ISO 8859 and PC code pages). #10183 measuredsceCesSbcToUtf8andsceCesUtf8ToSbcon a PS5 and found undefined bytes answering0x805C0020in both directions, which is what theUnassignedentries here answer; it rewritessbcToUnicodeto the sameboolshape, so whichever lands second resolves one hunk to the same code. #9175 adds a debt entry two lines above this one's.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-24T00:13:08Z.
Review: APPROVED
Reviewed head cb3277e. The profile tables and converter paths consistently handle the low-byte overrides and unassigned high-byte sentinels, and the added tests exercise scalar and MBCS round trips across the profiles. I independently confirmed the JIS X 0201 Roman/katakana mappings against Unicode's JIS0201 mapping and ran C++20 syntax checks on Export.cpp and GuestCesIso646.cpp; both pass. The author reports the full focused Linux and Windows test runs in the PR description. The current hosted run passes conventions, eligibility, intake, labels and report; platform builds are skipped for these paths. I could not run the product tests in this environment because the SDL2 submodule and XRandR development dependency are unavailable. I found no blocking issue at this head.