Repository navigation
Read piped CLI input as UTF-8 - #133
Merged
stefankoegl merged 1 commit intoNov 28, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the UTF-8 standard-input handling change.
No open issues 🎉
What changed in this PR
This PR makes the CLI decode piped and redirected standard input as UTF-8, preventing corrupted Unicode names in JSON documents and pointer expressions. Interactive input retains the terminal encoding.
Changes:
- Route JSON and pointer reads through a shared input helper.
- Add regression coverage for UTF-8 input under a legacy standard-input encoding.
- Document UTF-8 decoding for piped and redirected input.
| File | Description |
|---|---|
| tests.py | Adds legacy-encoding regression tests and updates the interrupt-test mock. |
| doc/commandline.rst | Documents - input and UTF-8 decoding for redirected standard input. |
| bin/jsonpointer | Adds shared input handling for JSON documents and pointer expressions. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When standard input uses a legacy encoding, passing UTF-8 JSON or a pointer via
-can corrupt Unicode member names. The CLI can then fail to resolve a valid pointer or resolve a different member.Decode redirected standard input as UTF-8 for both JSON documents and pointer expressions. Interactive input continues to use the terminal encoding.