Skip to content

Change content handling to use byte buffer instead of parsing chunks directly#299

Merged
szabodanika merged 5 commits into
szabodanika:masterfrom
ybalbert:master
Jan 24, 2026
Merged

Change content handling to use byte buffer instead of parsing chunks directly#299
szabodanika merged 5 commits into
szabodanika:masterfrom
ybalbert:master

Conversation

@ybalbert

@ybalbert ybalbert commented Jan 14, 2026

Copy link
Copy Markdown
Contributor

This change is to prevent an error that a multi-bytes UTF-8 character gets split across multiple chunks and fails to decode. The error could happen when pasting a long paragraph without whitespace in language like Chinese:

called `Result::unwrap()` on an `Err` value: Utf8Error

Tested by building a local docker image. The error doesn't happen any more on the same content.

Refactor content handling to use BytesMut to avoid splitting multi-bytes UTF-8 across two chunks.
Refactor content handling to use a buffer to prevent UTF-8 parsing error.
@szabodanika szabodanika self-requested a review January 15, 2026 09:35
@szabodanika

Copy link
Copy Markdown
Owner

Thanks @ybalbert ! Can you provide an example string to test this with?

@ybalbert

Copy link
Copy Markdown
Contributor Author

Sure, here's the pasta (expires in 6 days) I used for testing.

@szabodanika szabodanika merged commit d44d15f into szabodanika:master Jan 24, 2026
3 checks passed
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.

2 participants