feat(libSceIcu): implement the ucnv converter name queries #24274
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/24274"
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 Callimann8 on 2026-11-20T12:53:13Z.
What
Implements six converter name queries in libSceIcu that were throwing stubs in
LegacyExports.cpp:ucnv_countAvailable,ucnv_getAvailableName,ucnv_countAliases,ucnv_getAlias,ucnv_countStandardsanducnv_getStandardName. These are the calls WebKit's ICU text codec uses to build its encoding name table, so a web view that registers encodings no longer stops on the first one.They sit next to
ucnv_getAliasesinConverterAliases.cppand forward to the bundled ICU, following the same pattern:ucnv_countAvailable,ucnv_getAvailableNameanducnv_countStandardstake no guest pointers and return ICU's result directly.ucnv_countAliases,ucnv_getAliasanducnv_getStandardNameread the status with a checked copy and return 0 or null without touching other arguments when it already holds a failure. Otherwise they check the status is writable, copy the alias, converter and standard names in through checked guest reads (null stays null), call ICU and write back a changed status.std::invalid_argument; unreadable names or status throw throughNotImplemented_nid_no_patch.ucnv_getAliasesalready returns them.The bundled ICU data package omits
cnvalias.icu, so today these report zero converters, zero standards orU_FILE_ACCESS_ERRORinstead of throwing. The new debt fragment records that and that the console prototypes are unverified.Tested
Linux (Ubuntu 24.04, GCC 13.3).
guest_icu_converter_aliasesgains aNameQueriescase: signature checks, parity with the pinned ICU for every function across in- and out-of-range indexes, null, empty, valid, fuzzy-matched, unknown and over-long names, several standards and five incoming status values, guest readability of returned strings, null status, unreadable status, a status that is already a failure, and unreadable name and standard pointers. The test passes in a Release build and in an ASan + UBSan build (ANYPS5_ENABLE_ASAN=ON,-fsanitize=undefined);guest_icu_converter_available_names,guest_icu_converter_canonical_nameandguest_icu_converter_helpersalso pass. Only libSceIcu changed, so the full emulator build was skipped. Not tested on a console.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)Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-20T12:58:21Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
4e8bdbceb9:tools/check_conventions.pypassed.guest_icu_converter_aliases_testsbuilt cleanly.guest_icu_converter_aliases):core/libs/prx/libSceIcu/ConverterAliases.cpp,core/libs/prx/libSceIcu/LegacyExports.cpp,core/libs/prx/libSceIcu/include/LegacyExports.hppreverted 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-20T13:35:39Z.
Review: COMMENTED
Reviewed — no blocking findings
The reviewed change implements the six ICU converter name queries with checked guest access for status and name arguments; no concrete blocking defect was verified.
What I ran
Reviewed head
4e8bdbceb9bf8c5f0a3bc9aa28d7208ade4b9f6bfrom the prepared diff and pinned reader. No build or tests were run. The PR description reports Linux Release and ASan/UBSan test runs; those were not independently verified.Files read:
review/description.md,review/commits.md,review/manifest.json,review/diff.patch,core/libs/prx/libSceIcu/ConverterAliases.cpp,core/libs/prx/libSceIcu/include/LegacyExports.hpp(header lines 1–20), andcore/libs/tests/GuestIcuConverterAliases.cpp.Results
Findings
Blocking
None verified in the inspected code.
Non-blocking
None.
Not verified
LegacyExports.cppanddocs/dev/debt/changes/feat-icu-ucnv-name-queries.mdwere listed in the manifest but not read; their full text was not available in the prepared artifact and they were not inspected through the reader. The changed header declarations were located through the diff and repository search, but the full header was not read. No tests, build, console behavior, or console ABI were independently verified.files.jsonwas not available through the reader, so excluded-file details beyond the manifest were not checked.To get this to a good state
Nothing is required.