Skip to content

fix: keep multibyte characters split across output chunks - #3

Merged
autoantohaki merged 1 commit into
mainfrom
fix/split-utf8-characters
Oct 21, 2026
Merged

autoantohaki merged 1 commit into
mainfrom
fix/split-utf8-characters

Conversation

@autoantohaki

Copy link
Copy Markdown
Member

Requested by mau

Before: When a child process writes non-ASCII text such as café ✓, and a pipe chunk boundary falls inside a character, that character shows up as replacement characters (�) on the card.

After: The text is shown correctly no matter where the chunk boundary falls.

How: LineBuffer now decodes buffers with Node's streaming StringDecoder and flushes any remaining bytes in flush(). The new test fails against the old code and passes with this change.

Child output arrives in arbitrary byte chunks, and decoding each chunk on
its own turned a character split at a chunk boundary into replacement
characters. Decode with a streaming UTF-8 decoder instead.
@autoantohaki
autoantohaki force-pushed the fix/split-utf8-characters branch from d7a253c to 9025eaa Compare October 21, 2026 21:45
@autoantohaki
autoantohaki merged commit 4621289 into main Oct 21, 2026
6 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.

1 participant