Commit Graph
2 Commits
Author SHA1 Message Date
MarcZX10 730145d38a feat(libSceIcu): implement u_strToJavaModifiedUTF8
Convert UTF-16 to Java modified UTF-8 following ICU 78.1 ustrtrns.cpp.
Every code unit is encoded on its own, so surrogates become three bytes
each and U+0000 becomes C0 80. Output stops at the first unit that does
not fit and the remaining units are only counted for the preflight length;
the terminator and warning or overflow codes follow u_terminateChars.

The sceIcuUnknown stub with this NID is removed.
2026-11-05 21:54:13 +00:00
MarcZX10 691c469caa feat(libSceIcu): implement u_strFromJavaModifiedUTF8WithSub
Convert Java modified UTF-8 to UTF-16 following ICU 78.1 ustrtrns.cpp.
One to three byte sequences are decoded without the overlong and
surrogate checks of standard UTF-8, so C0 80 is U+0000 and encoded
surrogates pass through; four byte sequences and truncated or malformed
ones are replaced by the substitution character, or fail with
U_INVALID_CHAR_FOUND when it is U_SENTINEL. The bytes a malformed sequence
swallows follow ICU's utf8_nextCharSafeBody. As in ICU, once the
destination is full each substituted sequence adds one unit to the
preflight length even when the substitution character is supplementary.

The sceIcuUnknown stub with this NID is removed.
2026-11-05 21:54:05 +00:00