Skip to content

Fix writing half code points to Android logger#97

Open
middagj wants to merge 2 commits intorust-mobile:masterfrom
middagj:utf8
Open

Fix writing half code points to Android logger#97
middagj wants to merge 2 commits intorust-mobile:masterfrom
middagj:utf8

Conversation

@middagj
Copy link
Copy Markdown

@middagj middagj commented Apr 2, 2026

This fixes if a Unicode code point is incorrectly split when writing it to the Android logger. Both split_at (split_at_checked) and floor_char_boundary use is_utf8_char_boundary. I added a method that combines both functions. Also floor_char_boundary is relatively new (1.91).

Second commit is reducing the fully unsafe function where already separate unsafe blocks where introduced. I don't know if the unsafe fn was intended as a marker, but it also makes it possible to unintentionally introduce more unsafe calls in the function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant