feat(libSceCesCs): convert two-byte EUC-JP characters through the CP932 table #5686
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5686"
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 ps54all on 2026-10-14T06:30:50Z.
Depends on #5515 (this branch carries its commit until it merges; the diff of this PR alone is the second commit,
50afd8ce0).What
The EUC-JP profile from #5515 converts ASCII and half-width katakana and throws on every two-byte character. This adds the two-byte rows
0xA1-0xFE:core/libs/prx/libSceCesCs/JisX0208.hppholds a 94x94 table (7336 of 8836 cells assigned) from Microsoft code page 932, read through the standard JIS row/cell to Shift-JIS arithmetic and Python'scp932codec. It includes NEC row 13 and the NEC-selected IBM rows 89-92 and maps the Microsoft variants (U+FF5E at0xA1C1, U+2225, U+FF0D, U+FFE0-U+FFE2). Against Python'seuc_jpcodec, the only differences are those variants, row 13 and rows 89-92.UNASSIGNED_CODE, a trail byte outside0xA1-0xFEreturnsINVALID_ENCODE, a cut pair returnsSRC_BUFFER_END.0x8F) characters still throw.docs/dev/debt/libSceCesCs.mdrecords that the console's CP51932 table equalling cp932 is assumed, that its error codes for these cases are not known, and what stays unimplemented. I also rewrote thesceCesMbcsUcsContextInitentry, which still said nothing is stored.Tested
Windows 11, RTX 3080, WinLibs GCC 15.2.0 r7, Release, on main
f74ec639c.guest_cesandguest_ces_module(18 ces-related tests in total pass): hiragana and kanji convert UTF-8 to EUC-JP and back (こんにちは日本語isA4B3 A4F3 A4CB A4C1 A4CF C6FC CBDC B8EC), UCS-2 in and out, a NEC row 13 character (U+2460 isADA1), U+FF5E (A1C1), a character with several cells encoding to the lowest (U+2252 isA2E2), an unassigned cell, a bad trail byte, a cut pair, a code point with no cell (U+00A5), and a round trip over every one of the 7336 assigned cells. Without the table code the test aborts at the first two-byte conversion; with it both pass.python tools/check_conventions.py --base origin/mainandtools/check_test_registration.pypass.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repository🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T14:19:29Z.
Checked the build,
guest_ces/guest_ces_module(pass;guest_cesfails without the table code) and the buffer/limit handling of the two-byte path. I also regenerated the 94x94 table from Python'scp932codec through the JIS-to-Shift-JIS arithmetic: all 8836 cells match (7336 assigned).Added on your branch: rebased onto current
main, dropping the #5515 commit that already landed (its content is onmainwith our edits), and resolved thedocs/dev/debt/libSceCesCs.mdconflict by keeping your new entry text. Merging once the full build is green.Imported from boykopovar/AnyPS5. Originally posted by ps54all on 2026-10-14T16:08:19Z.
Thanks @adriadam10, also for regenerating the 94x94 table independently and dropping the landed #5515 commit from the branch.
AI-assisted (Claude Code).