feat(libSceIcu): implement the resource UTF-8 accessors #24357
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/24357"
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 larpsahur333 on 2026-11-20T15:05:50Z.
What
Three
libSceIcuexports that answeredNotImplemented_nid_no_patchnow read the ICU 68.2 resource string layout and convert it to UTF-8:ures_getUTF8String- the bundle's own string resourceures_getUTF8StringByIndex- a string from an array or table slot, or a top-level string at index 0ures_getUTF8StringByKey- a string from a table entryThey follow ICU's
ures_toUTF8String: the UTF-16 units are read frompRoot + offset*4,capacityandpLengthare copied in and out, a negative capacity or a positive capacity with a null destination isU_ILLEGAL_ARGUMENT_ERROR, an undersized buffer is preflighted withU_BUFFER_OVERFLOW_ERROR,forceCopykeeps the output atdestwhile a false value may place it at the tail of the buffer, and an empty string returns the empty pointer. A non-string resource reportsU_RESOURCE_TYPE_MISMATCH, a missing key or indexU_MISSING_RESOURCE_ERROR, and a nullpRootU_UNSUPPORTED_ERROR.Pool bundles and fallback chains remain unsupported, and the base
ures_getString*exports are still stubs, so these read the bundle layout directly.Tested
guest_icu_resource_utf8(core/libs/prx/libSceIcu/tests/ResourceUtf8.cpp) passes. It builds synthetic 200-byte bundles and a synthetic resource pool, so noicudtdata is needed:ures_getUTF8Stringcopies"hi", preflights a zero capacity (status 15, length 2), keepsforceCopyatdest, places the string at the tail whenforceCopyis false, reportsU_STRING_NOT_TERMINATED_WARNINGfor an exact-size buffer, terminates an empty string, and rejects an array, a null bundle and a negative capacityures_getUTF8StringByIndexreturns the two array strings, the table value and a top-level string, and reportsU_MISSING_RESOURCE_ERRORpast the end and for a negative indexures_getUTF8StringByKeyreturns the keyed table string and reportsU_MISSING_RESOURCE_ERRORfor a missing or null key andU_RESOURCE_TYPE_MISMATCHfor an arraypython core/libs/tests/test_public_headers.py --compiler g++reports413 libraries, 34735 exports: unique declarations and umbrella coverage verified.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 repositoryImported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T15:17:56Z.
Review: COMMENTED
Reviewed — comments
The review folder and repository files could not be read in this environment, so the change is not verified and no formal approval or change request is justified.
What I ran
Not run. No reader or shell tool is available in this session.
Results
Findings
Blocking
None verified.
Non-blocking
Review is incomplete because the prepared review materials and changed files could not be inspected.
Not verified
The description, commits, diff, manifest, changed files, and repository context were not read. Files read: none. Files listed for review: not verified.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-20T15:35:40Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
4fae6fceab:tools/check_conventions.pypassed.guest_icu_resource_utf8_testsbuilt cleanly.guest_icu_resource_utf8):core/libs/prx/libSceIcu/LegacyExports.cpp,core/libs/prx/libSceIcu/RecoveredSignatures.hpp,core/libs/prx/libSceIcu/include/LegacyExports.hpp,core/libs/prx/libSceIcu/ResourceUtf8.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T16:33:05Z.
Review: COMMENTED
Reviewed — no blocking findings
The implementation and all changed lines listed in the manifest were inspected at head
706b3dfe812da0c60938468ba94ecd01420879d1; the author reports passing tests, but I did not run them.What I ran
No commands or tests were run. I read the prepared description, commit summary, diff, manifest, and all changed files’ added lines; I also inspected the implementation and test source.
Results
Negative control
Not run; no test execution was available in this review.
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
The author reports that
guest_icu_resource_utf8and the public-header check passed; I did not run or independently verify either. Build and console behavior were not checked. All seven changed files in the manifest were included; all files with added lines were read, while the two changed files with no added lines were inspected through the diff only.To get this to a good state
Nothing is required. Optional: confirm the reported test results in CI.