feat(libSceCesCs): implement generic MBCS character, Shift-JIS code and JIS X 0213 helpers #8993
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8993"
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 simonbronk on 2026-10-21T08:57:58Z.
What
Implements 13 libSceCesCs exports on top of the MBCS profiles of #8967, #8972 and #8976 (this branch carries their commits; the new commit is dc819fc6b):
sceCesMbcToUcs2,sceCesMbcToUtf8,sceCesMbcToUtf16/be/le,sceCesMbcToUtf32/be/le: convert one character with any profile the MBCS context accepts (Shift-JIS CP932, EUC-JP CP51932, GBK CP936, EUC-CN and the Cp1250/1251/1252 single-byte profiles), through the same helpers as the per-encoding scalar forms.sceCesSJisGetCode,sceCesSJisPutCode: read and write one raw Shift-JIS code (one byte for ASCII and0xA1-0xDF, two bytes for a valid lead/trail pair), without checking that the cell is assigned.sceCesSJisCodeToJisX0213,sceCesJisX0213ToSJisCode: Shift_JIS-2004 arithmetic of JIS X 0213 annex 1; plane 1 as JIS X 0208, plane 2 rows 1, 3-5, 8, 12-15 and 78-94 on leads0xF0-0xFC.sceCesMbcsUcsContextInitCopy: copies the profile pointer stored bysceCesMbcsUcsContextInit.Signatures follow the Orbital type database. Errors and their precedence follow the existing converters and are recorded as unverified in
docs/dev/debt/libSceCesCs.md.sceCesMbcsUcsSetMbcsReplacementCharCode/UCodestay throwing: the context does not model a replacement character and its behaviour is unknown. Pending libSceCesCs exports: 161 → 148.Tested
macOS (Apple clang, C++20): compiled
libSceCesCssources with the newcore/libs/tests/GuestCesMbc.cpp(registered asguest_ces_mbcandguest_ces_mbc_module) and ran it, plus the existingGuestCes,GuestCesUnicode,GuestCesJapanese,GuestCesWideandGuestCesChinese: all pass. The full CMake/ctest build was not run (it does not build on macOS).tools/check_conventions.py --base origin/mainpasses. Not tested on Linux, Windows or a title.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
Imported from boykopovar/AnyPS5. Originally posted by rooklz on 2026-10-21T13:08:24Z.
@simonbronk are you planning to keep going with libSceCesCs after this stack? Two pieces look open to me: the single-character Big5/EUC-KR/UHC forms (to and from UCS-2/UTF-16/UTF-32, from the CP949/CP950 tables already on main), and the
*ToMbcencode direction that this PR leaves throwing. If you are not, I would pick them up on top of #8976/#8993 once they land, so we do not end up editing the same functions.Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-21T13:22:38Z.
@rooklz Thanks for asking. I'm not planning to take either piece, so please go ahead with both. Heads-up:
dc7be1b07on main now conflicts with the stack (#8967 → #8972 → #8976 → #8993). I'm resolving that now, so please build on the updated branches once they're pushed.Imported from boykopovar/AnyPS5. Originally posted by rooklz on 2026-10-21T14:19:24Z.
Opened #9175 on top of your stack for the
*ToMbcencode side, thanks. The Big5/EUC-KR/UHC scalar forms turned out to be in #9107 (jacob6769, opened earlier today on top of main), so I dropped mine; mentioning it since #9107 touches the same parts ofExport.cppandPendingExports.cppas your stack.Imported from boykopovar/AnyPS5. Originally posted by rooklz on 2026-10-21T14:20:18Z.
@simonbronk one more question so we do not collide: would you mind if I also took the strict JIS X 0208 profiles (
sceCesUcsProfileInitEucJpX0208,...X0208Ss2,...X0208Ss2Ss3,sceCesUcsProfileInitSJis1997X0208, from unicode.orgJIS0208.TXT) and the GB18030-2000/2005 profiles (ICUgb-18030-*.ucm) after your stack, or are those on your list?Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-21T14:36:20Z.
@rooklz Not on my list, so go ahead with both after the stack. Thanks for flagging #9107.
Imported from boykopovar/AnyPS5. Originally posted by ycbuzi on 2026-10-21T17:51:24Z.
Windows run of
c020ce8934merged ontomain80565c5942(40b4bd217e, clean), the platform the description lists as not tested. Windows 11 Home 10.0.26200, MinGW-w64 GCC 15.2.0 (ucrt-posix-seh r7), Release,BUILD_TESTING=ON.Built
libSceCesCs,libSceCesCs-moduleand the 13 test executables with no errors or warnings.ctest --repeat until-fail:2on the 13 tests these executables register on Windows: all pass on both repeats. The 13 are theguest_ces_*tests other than the baseguest_ces, the newguest_ces_mbcandguest_ces_mbc_moduleamong them. The head carries the stack below it (#8967, #8972, #8976) too. Not run: a title.Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-21T18:17:01Z.
Linux run of
c020ce893merged ontomain99844c7ee(clean merge).Environment: Ubuntu 24.04 x86-64 container under Rosetta on Apple Silicon (Colima), GCC 13,
RelWithDebInfo,BUILD_TESTING=ON,ANYPS5_ENABLE_ASAN=ON. ASan builds dynamic executables, so this is not the CI configuration.Results: the full build has no errors.
guest_ces,guest_ces_chinese,guest_ces_dbcs,guest_ces_japanese,guest_ces_mbc,guest_ces_unicode,guest_ces_wideand their module forms: all pass, with no AddressSanitizer report.Not run: the static CI configuration, native x86-64 hardware, GPU tests, a title.
AI-assisted (Claude Code).