Repository navigation
fix(libSceCesCs): terminate and count MBCS string conversions as measured on a PS5 - #10185
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r-measured-ps5 # Conflicts: # core/libs/prx/libSceCesCs/Export.cpp # core/libs/tests/GuestCes.cpp # docs/dev/debt/libSceCesCs.md
…F-32 round trip Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-measured-ps5 # Conflicts: # core/libs/tests/GuestCes.cpp # docs/dev/debt/libSceCesCs.md
…s-mbcs-strings-measured-ps5 # Conflicts: # core/libs/tests/GuestCes.cpp
…ured on a PS5 The UTF-16 and UTF-32 string forms and the UTF-8 to Shift-JIS and EUC-JP calls now share the measured string loop and UTF-8 decoder, and the Japanese tests expect JIS X 0212 to be neither decoded nor encoded. sceCesMbcsUcsContextInit rejects a null profile. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rough the shared loop Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r-measured-ps5 # Conflicts: # docs/dev/debt/libSceCesCs.md
…cs-mbcs-strings-measured-ps5 # Conflicts: # core/libs/prx/libSceCesCs/Export.cpp
…s-mbcs-strings-measured-ps5
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed the MBCS conversion-loop change at head 00b45d4, stacked on #10183 and #10184. The shared loop clears lengths and initializes the terminator before validation, preserves converted prefixes on error, reserves terminator capacity, and handles sourceMax=0 as the measured NUL-terminated mode. UTF-8/EUC-JP/UCS-2 decode paths and the new focused cases align with the described firmware measurements. This exact head is included in the descendant #10186 syntax check; its hosted eligibility, conventions, intake, labels and report checks pass, while product builds are path-skipped. The author reports the ten focused tests passing three consecutive runs on Windows. I could not execute them here because full CMake configuration is blocked by the missing SDL2 development package. The declared dependencies match the branch stack.
|
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.
Some 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.
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MarcZX10
left a comment
There was a problem hiding this comment.
Re-review of exact current head e4ed848821e95fb162923e68991d6c32d9d5cfb8. The source/test/debt diff against current main is unchanged by this head's merge-main refresh. Its checklist records the agreed #10183/#10184 prerequisites, and #10186 records #10185 as its prerequisite; #10056 then depends on #10186. Exact-head repository conventions and git diff --check pass, and GCC C++20 strict syntax-only compilation of the CES export passes. Hosted eligibility, conventions, labels and report pass; product test/build jobs are path-skipped. The author reports the focused CES tests passing three runs; no full runtime suite was available locally. Approving this exact head in the agreed stack order.
|
@orezraey #9204 and #9210 are landing ahead of this PR and both change |
Keep boykopovar#9204's strict JIS X 0208 profiles with their SS2 and SS3 choices inside the new helpers: decodeEucJp sends the measured CP51932 profile to decodeEucJpScalar and the strict profiles to boykopovar#9204's rules, and only the X0208Ss2Ss3 profile encodes JIS X 0212. The EUC-KR, UHC and Big5 UTF-8 forms decode with decodeScalarUtf8. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merged main (with #9204) in cce3beb. A new |
|
@orezraey The #9204 resolution preserves strict JIS and the measured CP51932 split. Please retain the #9210 prerequisite: after it lands, fold supplementary GB18030 decode/encode and encodeUtf16 into Ces.cpp’s convertString without losing that split, then rerun all 14 guest_ces cases on Linux and Windows and report the final head. The current branch still lacks that integration, so the earlier request is only partly resolved. |
|
Agreed, #9210 stays the prerequisite, and it is still open. Once it lands I will fold its supplementary GB18030 decode/encode and |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The strict JIS X 0208 EUC-JP profiles from main keep their decodeMbcs path in sceCesEucJpToUcs2 and sceCesEucJpToUtf8; the measured scalar decoder applies to the CP51932 profile it was measured with. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…trings-measured-ps5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rings-measured-ps5 Brings in main with boykopovar#9210. The MBCS string forms keep convertString and now encode UTF-16 with encodeUtf16, so GB 18030 supplementary characters become surrogate pairs and UCS-2 answers UNASSIGNED_CODE. The GB 18030 string test checks the short-buffer error in its own buffer, since a failed conversion now terminates the output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
#9210 has landed, so this branch now merges #10183 and #10184 refreshed on |
|
@rooklz: #9175, #10426, #10430 and #10431 change the same lines as this PR in |
|
@rooklz #10718 and this PR both rewrite the EUC-JP decoder in |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What
The MBCS string conversions (
sceCesUtf8StrToMbcsStr,sceCesUcs2StrToMbcsStr,sceCesMbcsStrToUtf8Str,sceCesMbcsStrToUcs2Strand theirGet*Lenforms) wrote no terminator and set no length on an error. I measured them on a retail PS5 (firmware 13.60) with homebrew probes, from a payload process loadinglibSceCesCs.sprx, with the Cp1252 and EUC-JP profiles. The sources and console logs are in this gist (pces8,pces9,pces10).On the console:
ABCinto 3 bytes givesAB, a terminator and0x805C0031with lengths 2 and 2. With a capacity of 0, nothing is written.A, 0x81,Bin Cp1252 returns0x805C0020with lengths 1 and 1 and the outputA, terminator.0x805C0001), source (0x805C0010), output (0x805C0030).sceCesUtf8ToSbcdoes: overlong forms and surrogates give0x805C0015, and a zero byte inside a sequence is an invalid byte.0x805C0015.sceCesEucJpToUcs2does, so8F A2 AFgives0x805C0014.0x805C0020with the EUC-JP profile. We encoded them as0x8Ftriples.This PR implements all of the above with one conversion loop shared by the eight functions.
sceCesMbcsUcsContextInitwith a null profile now returns0x805C0001as well, as the console did; before, it stored the null profile.Not changed, recorded in the debt file. The console encodes U+00A5, U+203E and U+0080–U+009F to EUC-JP bytes where we answer
UNASSIGNED_CODE. Its Shift-JIS encoder answers0x805C0024for U+0080–U+009F and accepts the JIS forms of a few Microsoft characters. These table choices are a separate change. A zero-filled context converted nothing and returned 0 on the console; here it returns0x805C0001.Depends on the two scalar PRs, for
decodeScalarUtf8anddecodeEucJpScalar. This branch carries their commits until they merge.On top of #8967 and #8972. The UTF-16 and UTF-32 string forms from #8972 now run through the same loop, so they stop, terminate and count the same way.
sceCesUtf8ToSJis,sceCesUtf8ToEucJpand the GBK and EUC-CN forms from #8976 decode UTF-8 likesceCesUtf8ToSbc. JIS X 0212 is neither decoded nor encoded, as measured, so twoguest_ces_japanesechecks that expected0x8FB0A1for U+4E02 now expectINVALID_ENCODEandUNASSIGNED_CODE.Tested
main(f26434afa3, with refactor(libs): add full export headers for libs #10706):4c3c3231d6. The test now takes its declarations fromlibSceCesCs/include/Api.hpp(sceCesRefersUcsProfileCp1250returnsconst void*there, so the test casts it). The 14guest_ces*tests pass three runs in a row on Windows (MinGW) and on Linux (WSL Ubuntu, GCC);public_headersaudit andcheck_conventionspass.Windows 11, MinGW (winlibs).
guest_ceschecks:Get*Lenforms;guest_ces_dbcshad output buffers with no room for a terminator. It now keeps that room; before, it passed without converting anything.guest_ces*tests pass three runs in a row.tools/check_conventions.pypasses.tools/pr_overlap.pylists feat(libSceCesCs): add 27 single-byte code page profiles #8923, feat(libSceCesCs): add the Windows-1253, 1255 and 1257 profiles #9912 and feat(libSceCesCs): add the GB18030-2000 and GB18030-2005 profiles #9210 (other code pages inExport.cppand the tests) and test: organize library tests and label CTest suites #6044 (moves test files).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)GuestCes.cpp(merge order only); fix(libSceCesCs): report the length of a rejected MBCS character as the console does #10722, fix(libSceCesCs): map the GB 18030 profiles as the console does #10739, feat(libSceCesCs): report the JIS X 0213 level of a cell as the console does #10751 edit the same lines too (merge order only)