Skip to content

Fix split UTF-8 token decoding - #1094

Open
mayocream wants to merge 1 commit into
utilityai:mainfrom
mayocream:fix/split-utf8-token-decoding
Open

Fix split UTF-8 token decoding#1094
mayocream wants to merge 1 commit into
utilityai:mainfrom
mayocream:fix/split-utf8-token-decoding

Conversation

@mayocream

@mayocream mayocream commented Aug 8, 2026

Copy link
Copy Markdown

decode_to_string does not grow its destination. Allocating bytes.len() is too small when a UTF-8 character spans token pieces, so unread bytes can be silently dropped.

Use the decoder's output bound and add a regression test for split CJK token pieces.

@mayocream
mayocream marked this pull request as ready for review August 8, 2026 16:37
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