feat(libc): implement isascii and toascii #8919
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8919"
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 iAbdulrrahman on 2026-10-21T06:11:19Z.
What
Implement standard ASCII character classification and conversion exports isascii (NID 29nFZNtp8s) and oascii (NID UAg7CJ8TXis) in libc.
Extend unit tests in core/libs/tests/GuestCharacter.cpp covering ASCII validation and bitmasking over values in and outside the standard range.
Tested
Checklist
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T06:16:33Z.
The conventions check currently fails with
section 'What' is missing or empty, even though the section is visible in the PR body. The body starts with a UTF-8 BOM (\uFEFF) before### What; removing that leading BOM should let the required-heading parser recognize it. The implementation and boundary tests look straightforward, but I have not run the full build/test target.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T06:20:41Z.
Review: APPROVED
The author removed the leading BOM and the current conventions check now passes. The implementation matches the ASCII range check and low-seven-bit conversion, and the tests cover negative and above-ASCII values. I reviewed the diff but did not run the guest test binary locally; the PR description reports the cases added, and runtime CI is not providing a build here.
Imported from boykopovar/AnyPS5. Originally posted by iAbdulrrahman on 2026-10-21T06:20:48Z.
Thanks for pointing that out! The leading UTF-8 BOM has been removed from the description, and the conventions check is now passing green.
Imported from boykopovar/AnyPS5. Originally posted by r1p0N on 2026-10-21T07:29:41Z.
(c & ~0x7F) == 0 and c & 0x7F match glibc's isascii/toascii for every int in -70000..70000 (checked in isolation). Negative inputs and values above 255 are handled correctly, and the test covers them (-100, 128, 256, 258, -1).
LGTM. Not run: the full guest_character test through ctest.
Imported from boykopovar/AnyPS5. Originally posted by tkcm01 on 2026-10-21T18:12:36Z.
Windows data point for
285275e678, merged ontomain99844c7ee(clean merge). GitHub Actionswindows-latestrunning this repo's Build workflow (full Windows build, WinLibs GCC, Release,BUILD_TESTING=ON) on my fork.guest_characterincluded (run).mainplus only this PR'sGuestCharacter.cpp:guest_character_testsdoes not link (isascii_nid_postfixandtoascii_nid_postfixundefined), as expected for new exports (run).Not tested: Linux, macOS, a title.
AI-assisted: yes