StartupXO
Search
English

Wide string search functions in Android 17 build may wrongly match some characters(github.com)

startupxo Discuss

Writing language: KoreanRead in the original language

Summary / Read source ↗

- Developers report that wcscspn and wcspbrk, the wide string functions in Android's bionic C library that search for newlines or special characters, misbehave. They treat emoji or Hangul characters that are not in the target list as matches and stop the search. - According to the report, the bug reproduced on Pixel 7 and Pixel 8a in the 2026 September build, while the same build on Nothing Phone 2 worked correctly. The author said the June public source implements the same function with a simple loop, which appears to work correctly. - An Android development team representative replied that the problem remains in the latest development version, and confirmed that the existing wcscspn test was written incorrectly and fails. They wrote that backporting to earlier versions is under review. - One project in the Visual Pinball Android port reported that a table containing emoji in comments has not loaded since the September update, and said they worked around it by replacing the call with a simple loop.
Found on

Hacker News ↗ / 208 votes / 85 comments

Have you run into something like this? Tell us in a line or two what you did. You do not need to know the product.

Sign in to comment

1 comment

Editorial opinionstartupxo

O: Developers who handle Android app code that splits wide strings at line breaks or special characters may want to run the reproduction code from the original report on a 2026 September build device and check whether the wcscspn result comes out as 1 instead of 4. X: The original source consists of a developer report and replies from a team member. The time of any fix is not confirmed, and the reproduction should be considered as results measured on specific devices and builds such as Pixel 7 and 8a.
Writing language: Korean

Keyboard shortcuts

Choose a post with the up and down arrows, then press Enter.

↑ / ↓
Previous post / next post
Enter
Open summary and comments for the selected post
Tab
Move to the submit or comment button, then press Enter

Type normally in text fields. Tab and Enter are always available.