feat(libSceCesCs): convert EUC-KR, UHC and Big5 through the CP949 and CP950 tables #7884
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7884"
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 jacob6769 on 2026-10-19T12:22:24Z.
What
Implements the Korean and Traditional Chinese conversions that #7848 leaves as throwing stubs, plus the three profile constructors they need.
sceCesUcsProfileInitEucKr,sceCesUcsProfileInitUhcandsceCesUcsProfileInitBig5Cp950. Like the existing EUC-JP profile, they tag the caller's sheet. The names are in the aerolib table pinned bytools/nid_names.py(uAiUQEGDoNM,kWjWUyOGZQs,Lota-iiR+8M); signatures follow the Orbital type database.sceCesEucKrToUtf8,sceCesUhcToUtf8andsceCesBig5ToUtf8. Each call converts one character, including zero, and writes no terminator. Argument checks follow the same order assceCesEucJpToUcs2, and on failure the output and length pointers are left unchanged.sceCesMbcsStrToUtf8Str,sceCesUtf8StrToMbcsStr, the UCS-2 forms and theGet*Lenforms) accept the three profiles in both directions.Cp949.hpp(17,048 cells) andCp950.hpp(13,503 cells) are generated from Microsoft's CP949.TXT and CP950.TXT.0xA1-0xFE(KS X 1001, 8,226 cells).0x81and the extended Hangul trails0x41-0x5A,0x61-0x7Aand0x81-0xA0.UNASSIGNED_CODE.WideCharToMultiBytefor code page 950 and the WHATWG Encoding Standard.docs/dev/debt/libSceCesCs.md.Progress scanner: 3893/4738 (82.17%) to 3899/4741 (82.24%).
Left for follow-ups: the KS X 1003 single-byte profile (
sceCesEucKrUcsProfileSetSbcs,sceCesRefersUcsProfileKsX1003), and the other EUC-KR, UHC and Big5 scalar forms (UCS-2, UTF-16, UTF-32 and the reverse directions), which are not declared yet.Overlap: merges cleanly with #7848. With #7091, the profile checks in
toMbcsandfromMbcsconflict on one line each; whichever lands second addsisSjistoisMbcs.tools/pr_overlap.pyalso lists #6044 (test reorganization, which conflicts withmain) as sharinglibSceCesCs/CMakeLists.txtwithout a comparison; it implements none of these functions.Tested
Windows 11, WinLibs MinGW-w64 GCC 15.2.0, Release,
BUILD_TESTING=ON.MultiByteToWideChar(code pages 949 and 950) and Python'scp949andcp950codecs, with no differences.guest_ces_dbcsandguest_ces_dbcs_moduletests:*ToUtf8exports. The FNV-1a hash of the results matches values computed independently in Python from the unicode.org files.guest_ces_dbcsfail; restoring it passes.ctest -R "^guest_ces|progress|test_registration": 11/11 passed. The full suite was not run.tools/check_conventions.pyandtools/check_test_registration.pypass.tools/pr_overlap.pyreports only the #7091 lines and #6044 above.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 (none added).mdfiles or images added to the repository🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T12:23:17Z.
Progress report (
158d8ad→dc7be1b)📈 System libraries: 48.91% (+0.05%, +6 implemented functions)
✅ 6 implemented
sceCesBig5ToUtf8sceCesEucKrToUtf8sceCesUcsProfileInitBig5Cp950sceCesUcsProfileInitEucKrsceCesUcsProfileInitUhcsceCesUhcToUtf8Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T12:31:30Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libSceCesCs/Export.cppL10docs/dev/debt/libSceCesCs.mdL14core/libs/prx/libSceCesCs/Export.cppL387docs/dev/debt/libSceCesCs.mdL14core/libs/prx/libSceCesCs/Export.cppL387docs/dev/debt/libSceCesCs.mdL14core/libs/prx/libSceCesCs/Export.cppL10, L154-155, L264, L339, L366, L387docs/dev/debt/libSceCesCs.mdL14core/libs/prx/libSceCesCs/Export.cppL10, L154-155, L264, L339, L366, L387docs/dev/debt/libSceCesCs.mdL14Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libSceCesCs/CMakeLists.txtImported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-19T18:45:18Z.
Rebase handoff — rebased onto current
main(all commits, authorship unchanged). TheExport.cppguard conflicts resolved to yourisMbcssuperset guard (main's per-familyisEucJp/isSjis/isSbcguards superseded where the union had duplicated both).Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON, AMD RX 9070 XT / RADV): builds; the CesCs tests pass; conventions pass; full suite green apart from the four knownmainregressions (#5444 Mesa, #7584 BDA, #7766, #7784), none from this PR.To pick it up:
Head is
d8981141b.Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-19T18:52:23Z.
Correction on the handoff above: the first push had a real bug — my guard resolution replaced main's per-family guards with your
isMbcsbut dropped main's SJIS dispatch from it, so main's SJIS tests (unioned in) hit the CP949 path and aborted.isMbcsnow includesisSjis, and everything passes:guest_cesgreen, full suite green apart from the four knownmainregressions (#5444 Mesa, #7584 BDA, #7766, #7784), conventions pass. Head is now2738b54f1.Imported from boykopovar/AnyPS5. Originally posted by jacob6769 on 2026-10-20T10:14:07Z.
Thanks @blawesom for the rebase handoff and for catching the dropped SJIS dispatch in the guard resolution.
I rebased the branch onto current
main(d14a186f4) myself and resolved the guards the same way as your correction: both useisMbcs, which now includesisSjis. Head isf698dbef5. On Windows (WinLibs GCC, Release) all sixguest_ces*tests pass, andtools/check_conventions.pyis clean.Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-20T19:18:29Z.
Rebase handoff — your
f698dbef5(with theisMbcsguard carryingisSjisfrom my earlier correction) rebases onto currentmain(a9cfea22f) cleanly, no conflicts this time.Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON, AMD RX 9070 XT / RADV): builds;guest_cesand the full CesCs family pass; 1719/1722 — green apart from the three known current-mainfailures on this stack (#7784 guest-memory, tessellation pending Mesa 26.2.6,image_array_window_past_layer_limitflagged on #6772), none from this PR; conventions pass.To pick it up:
Head is
b888474b7.Imported from boykopovar/AnyPS5. Originally posted by nikowolf123 on 2026-10-20T22:04:19Z.
The new test only partly covers the Big5 duplicate-cell rule.
GuestCesDbcs.cppline 176 requiresRoundTripMismatches(context) == 10. Each of the ten duplicated characters produces exactly one mismatch, whichever cell the encoder picks, so the count is 10 for any choice. The explicit check on line 174 pins U+2550, U+256D, U+5341 and U+5345. Nothing checks U+255E, U+2561, U+256A, U+256E, U+256F or U+2570.For example, if
BIG5_LAST_CELLis reduced to{0x2550, 0x5341, 0x5345}, then U+255E, U+2561 and U+256A encode to A2A5, A2A7 and A2A6 instead of F9E9, F9EB and F9EA, andguest_ces_dbcsstill passes. The current choices are correct. The WCTABLE in Microsoft's bestfit950.txt maps U+255E, U+2561, U+256A, U+256E, U+256F and U+2570 to F9E9, F9EB, F9EA, A2A1, A2A3 and A2A2. The WHATWG index Big5 pointer takes the last cell for the same six characters that are inBIG5_LAST_CELL.I'd add one line after line 174 to pin the other six. It passes on this head and fails with the reduced list:
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-21T11:39:47Z.
Checked the CP949/CP950 decoding ranges, the Big5 duplicate-cell encoding, argument-check order and unchanged outputs on failure, and the table hashes in
guest_ces_dbcs. Thanks to @nikowolf123 for spotting that the Big5 test only pinned four of the ten duplicate cells; I added the line pinning U+255E, U+2561, U+256A, U+256E, U+256F and U+2570 (F9E9, F9EB, F9EA, A2A1, A2A3, A2A2) and resolved the debt-file adjacency conflict. CesCs tests pass; merged.