8000 Preserve UTF-8 characters across JSON CLI input chunks by Aschenbath · Pull Request #168 · kawanet/msgpack-lite · GitHub
[go: up one dir, main page]

Skip to content

Preserve UTF-8 characters across JSON CLI input chunks - #168

Open
Aschenbath wants to merge 1 commit into
kawanet:mainfrom
Aschenbath:fix/oss-20-20261125-77d1-msgpack-cli-utf8
Open

Aschenbath wants to merge 1 commit into
kawanet:mainfrom
Aschenbath:fix/oss-20-20261125-77d1-msgpack-cli-utf8

Conversation

@Aschenbath
Copy link
Copy Markdown
Contributor

JSON input containing a multibyte UTF-8 character across two read chunks is silently corrupted by the CLI. For example, a euro sign split at a file's 64 KiB read boundary becomes three replacement characters in both -J and -S modes.

Set the JSON input stream's UTF-8 encoding so Node carries incomplete character bytes into the next chunk. The integration tests invoke bin/msgpack on a real file that splits the character at that boundary, covering JSON-to-MessagePack and newline-separated JSON conversion. Both regressions fail on unchanged main.

Validation on Node 24.22.0 / Windows: all 205 tests pass, plus JSHint, the deprecation check, browser build/minification, and the bundle export/size smoke checks. These are the make test steps invoked directly because make is unavailable on this host.

Prepared with OpenAI Codex assistance; reproduced and reviewed against the implementation and tests.

This branch has not been deployed

No deployments
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

0