feat(libSceCesCs): convert GBK and EUC-CN through the CP936 table #8976
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8976"
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:11:47Z.
What
Implements 34 libSceCesCs exports that were pending stubs:
sceCesUcsProfileInitGbkCp936,sceCesUcsProfileInitEucCnGb2312sceCesGbTo{Ucs2,Utf8,Utf16,Utf16be,Utf16le,Utf32,Utf32be,Utf32le}andsceCesEucCnTo{…}sceCes{Ucs2,Utf8,Utf16,Utf16be,Utf16le,Utf32,Utf32be,Utf32le}ToGband…ToEucCnThe new
Cp936.hppholds the 21,791 double-byte cells of Microsoft's CP936.TXT, with single-byte0x80mapped to U+20AC as that file does. The GB 2312 mapping file is no longer published by unicode.org, so the EUC-CN profile uses the same table restricted to0xA1-0xFElead and trail bytes; the differences this implies (GBK cells inside that range, CP936 forms of0xA1A4and0xA1AA) are recorded indocs/dev/debt/libSceCesCs.md. The MBCS string conversions (sceCesUtf8StrToMbcsStrand the others) accept both profiles. The scalar helpers from #8967 are renamed from*Japaneseto*Profiledbecause they now serve both languages. Signatures follow the Orbital type database. Errors follow the existing converters and are not console measurements. User-defined areas, GB 18030 four-byte forms andsceCesGbUcsProfileSet*stay unimplemented. libSceCesCs goes from 86 to 120 of 284 intools/progress.py.This branch is stacked on #8972 (itself on #8967); only the top commit is new.
Tested
macOS 27 (Apple silicon), clang, C++20: libSceCesCs sources and tests compiled outside CMake, since the full build does not run on macOS. Passing:
guest_ces_chinese: errors, byte orders, a GBK and EUC-CN round trip of every encodable BMP code point, and GBK strings through an MBCS context;guest_ces,guest_ces_unicode,guest_ces_japaneseandguest_ces_wide, with no regressions.Cross-check:
sceCesGbToUcs2on all 32,766 lead/trail pairs matches Python'sgbkcodec (24,066 identical decodes; all other pairs fail in both).The CMake/ctest build on Linux and Windows was not run locally.
check_conventions.pyis clean.pr_overlap.pylists only shared files with #8923, #7884 and #6044, none implementing these functions; #7884 edits the same MBCS dispatch inExport.cpp, so whichever lands second needs a rebase. No title tested.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 ycbuzi on 2026-10-21T08:28:23Z.
Windows run of a4049f3c3f merged cleanly onto
mainf894ba69d3, the CMake/ctest build the description lists as not run. The head carries the commits of #8967 and #8972 too. Windows 11 Home 10.0.26200, MinGW-w64 GCC 15.2.0 (ucrt-posix-seh r7), Release,BUILD_TESTING=ON.Built
libSceCesCs, its module form and the ten test executables with no errors or warnings.ctest --repeat until-fail:2onguest_ces,guest_ces_module,guest_ces_unicode,guest_ces_unicode_module,guest_ces_japanese,guest_ces_japanese_module,guest_ces_wide,guest_ces_wide_module,guest_ces_chineseandguest_ces_chinese_module: all ten pass on both repeats, the newguest_ces_chineseand its module form among them. Not run: Linux, a title.Imported from boykopovar/AnyPS5. Originally posted by clairtonmichel on 2026-10-21T08:43:43Z.
Tested on AMD Ryzen 7 9800X3D and AMD Radeon RX 7900 XTX (Fedora Linux, Mesa 26.2.5):
guest_ces_chinese, unicode, and module tests): 100% passed successfully (48/48 tests green).Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-21T18:16:56Z.
Linux run of
f974e91f0merged 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_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).
Imported from boykopovar/AnyPS5. Originally posted by ycbuzi on 2026-10-22T08:34:26Z.
Windows run of
f974e91f08, the update since my earlier run, merged ontomaind6eafa54d0(1d6ee41de0, clean). Windows 11 Home 10.0.26200, MinGW-w64 GCC 15.2.0 (ucrt-posix-seh r7), Release,BUILD_TESTING=ON.Built
libSceCesCs, its module form and the ten test executables with no errors or warnings.ctest --repeat until-fail:2onguest_ces,guest_ces_module,guest_ces_unicode,guest_ces_unicode_module,guest_ces_japanese,guest_ces_japanese_module,guest_ces_wide,guest_ces_wide_module,guest_ces_chineseandguest_ces_chinese_module: all ten pass on both repeats. Not run: a title.