feat(libSceCesCs): add the EUC-JIS-2004 and Shift_JIS-2004 profiles #10426
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10426"
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:02:35Z.
What
sceCesUcsProfileInitEucJis2004andsceCesUcsProfileInitSJis2004X0213now initialise profiles for EUC-JIS-2004 and Shift_JIS-2004 instead of throwing. Both work with the MBCS string, length and scalar functions throughsceCesMbcsUcsContextInit,sceCesMbcToUtf8and the rest, as the EUC-JP and Shift-JIS profiles do, and cover both planes of JIS X 0213: plane 1 as the two-byte range (EUCA1-FEpairs, Shift-JIS leads81-9FandE0-EF), plane 2 through SS3 (8F) in EUC and the leadsF0-FCin Shift-JIS with the row arithmeticsceCesSJisCodeToJisX0213already has, and the half-width katakana through SS2 or a single byte. The 303 characters outside the BMP come out as supplementary-plane scalars.The tables are a new
JisX0213.hppgenerated from Project X0213's JIS X 0213:2004 mapping table (free to use, modify and distribute per its header), oneuint32_tper cell of each plane. The 90 cells the table notes as having a fullwidth form use that form, which keepsA1 A4meaning,(U+FF0C) as it does on the JIS X 0208 profiles; where JIS X 0213's own mapping differs from CP932 (wave dash, em dash, overline) the JIS X 0213 value is used. The 25 kana cells that only exist as a base character plus U+309A are unassigned in both directions, since the converters produce one scalar per character. What a console answers for any of this is not measured; the debt entry says so.Measured on a PS5
I checked both profiles on a PS5 with homebrew payloads that load the console's
libSceCesCs.sprx:sceCesMbcToUtf32over every one-, two- and0x8F-led three-byte sequence andsceCesUtf32ToMbcover every value from U+0000 to U+110001. That found three table differences, now fixed:',",-and~; U+203E and U+00A5 still encode into 1-17 and 1-79;8F AA AF), and plane 2 wins for a code point in both (U+4E02 →8F A1 A2);0x0E, surrogates and error lengths, which other PRs cover for every profile.guest_ces_jis2004checks each of these both ways in both profiles.Tested
guest_ces_jis2004(new, both link variants): on EUC-JIS-2004,A4 A2,AE A1(a plane-1 row 14 character JIS X 0208 lacks),8F A1 A1(plane 2, U+20089),8E B6andA1 A4round-trip with UTF-8 and the mixed string of them with UTF-8 and UTF-32; the か゚ cell is unassigned both ways; a truncated pair or SS3 sequence, a bad trail, a lone80and a bad SS2 byte give the expected errors; a Thai character is unassigned; the scalarsceCesMbcToUtf8converts;sceCesEucJpToUcs2refuses the profile; and the EUC-JP CP51932 profile answers unassigned forAE A1. On Shift_JIS-2004,82 A0,87 9F,F0 40(plane 2),B6and the mixed string round-trip;82 F5is unassigned; a truncated lead,FDand a bad trail give the expected errors; and the Shift-JIS CP932 profile answers unassigned forF0 40.guest_ces,guest_ces_mbc,guest_ces_unicode,guest_ces_japanese,guest_ces_chinese,guest_ces_wideandguest_ces_dbcsstill pass.Linux x86-64 container (Ubuntu 24.04, GCC 13.3, Release, this head built from scratch with ccache):
guest_ces_jis2004andguest_ces_jis2004_modulepass, andguest_ces,guest_ces_mbc,guest_ces_unicode,guest_ces_japanese,guest_ces_chinese,guest_ces_wideandguest_ces_dbcspass, each binary run directly with its exit status checked.Hosted runners (verify run on my fork, which fails a job on any ctest failure): the Windows full build (Server 2025, WinLibs GCC 15.2.0, Release) compiles everything and passes all sixteen
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.check_conventions.pypasses.pr_overlap.pyreports #10056, #10185 and #10186 on the first lines ofdecodeMbcsandencodeMbcs, where this adds its one-line dispatch, #10214 on the debt file's neighbouring line, #9175 nearby inPendingExports.cpp, and #9912 as an uncompared sharer of the same files; none implements either export, and whichever lands second keeps both hunks.Hosted Linux runner, head
00703acb9c(verify run on my fork; Ubuntu 24.04, GCC, Release, lavapipe): everyguest_ces*test passes; its one failure,agc_driver_sgpr_pattern_fill_keys, ismain's on that runner.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-24T22:02:20Z.
Review: APPROVED
Reviewed exact head
00703acb9c97e8f02d434ec6cbe9bcec9d56bd0c.The two profile initializers route into the existing MBCS conversion paths, and the generated plane tables preserve the documented one-scalar-per-cell policy for decomposed kana. The PR includes direct PS5 round-trip observations across the input ranges, with the discovered compatibility-cell and EUC plane-fallback differences reflected in the current table; the new focused tests pin those cases and invalid/truncated sequences. The table source's stated reuse terms were checked in the earlier review work, and the PR's attribution/license provenance is present.
Current-main merge-tree is clean; the 20 newer main commits do not modify the CES files touched here. Current-main conventions and diff-check pass. The PR's latest Linux run is reported on this exact head; the earlier Windows full build/test run is author-reported, and upstream product jobs are skipped by the workflow gate. I did not run the CES binaries locally.
No blocking findings on this head.