feat(libSceCesCs): implement the EUC-KR, UHC and Big5 scalar conversions #9107
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9107"
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-21T12:30:44Z.
What
Implements the 45 EUC-KR, UHC and Big5 scalar conversions that are still pending stubs in
PendingExports.cpp. They use the profiles and CP949/CP950 tables from #7884:sceCes{EucKr,Uhc,Big5}To{Ucs2,Utf16,Utf16be,Utf16le,Utf32,Utf32be,Utf32le}sceCes{Ucs2,Utf8,Utf16,Utf16be,Utf16le,Utf32,Utf32be,Utf32le}To{EucKr,Uhc,Big5}Signatures follow the Orbital type database. All 45 names resolve in the aerolib table through
tools/nid_names.py --nid.sceCes{EucKr,Uhc,Big5}ToUtf8and the Shift-JIS and EUC-JP scalar conversions from #8967 do. No terminator is written and no byte order is detected.decodeMbcs, with the argument checks of the*ToUtf8forms in the same order: profile, source, source length, destination. The UTF-16 forms always write one unit, because both tables are BMP-only.encodeMbcs.INVALID_ENCODE.INVALID_ENCODE, orSRC_BUFFER_ENDwhen it is cut short.UNASSIGNED_CODE.profiledToUcs2,profiledToUtf16,profiledToUtf32,scalarToProfiled,utf32ToProfiledandbufferToProfiled) withisEucKr,isUhcorisBig5as the profile check. No helper is added.docs/dev/debt/libSceCesCs.mdnow covers the scalar forms. The pending-export count there goes from 121 to 76.tools/progress.py --module libSceCesCs: 166 to 211 of 287.Not included: the KS X 1003 profiles (
sceCesRefersUcsProfileKsX1003,sceCesRefersUcsProfileKsX1003Tilde0x7e) andsceCes{EucKr,Uhc}UcsProfileSetSbcsstill throw. KS X 1003 is a 7-bit set, so what the console does with bytes0x80-0xFFwould be a guess, and the tilde variant's mapping has no public source. #8923 leaves these profiles out for the same reason.Overlap:
sceCesUtf8To*scalar forms to the measured UTF-8 decoder (decodeScalarUtf8). They also make the MBCS string conversions write a terminator. If they land first,sceCesUtf8To{EucKr,Uhc,Big5}should use the same decoder, and the string-conversion reference inguest_ces_dbcsneeds room for the terminator.Tested
Windows 11, WinLibs MinGW-w64 GCC 15.2.0, Release,
BUILD_TESTING=ON.guest_ces_dbcsandguest_ces_dbcs_moduleare extended:*ToUtf8export, in the requested byte order. On failure, the outputs must be unchanged.sceCesUcs2StrToMbcsStrthrough a context, report the right source length, and leave its outputs unchanged on failure. Zero, U+20000 and U+10FFFF are checked too.guest_ces_dbcsfail, and restoring the code makes it pass again:profiledToUtf16;scalarToProfiled;bufferToProfiled.ctest -R "^guest_ces": 14/14 passed, including the Japanese, wide, Chinese and MBC tests frommain. The full suite was not run.tools/check_conventions.py(with this title and body) andtools/check_test_registration.py buildpass.tools/pr_overlap.pywas run before opening, and the overlap is listed above. No console or title was run.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)🤖 Generated with Claude Code