Skip to content

Read piped CLI input as UTF-8 - #133

Merged
stefankoegl merged 1 commit into
stefankoegl:masterfrom
boogu2005:fix/cli-utf8-piped-input
Nov 28, 2026
Merged

stefankoegl merged 1 commit into
stefankoegl:masterfrom
boogu2005:fix/cli-utf8-piped-input

Conversation

@boogu2005

Copy link
Copy Markdown
Contributor

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.

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 98.864%. remained the same — boogu2005:fix/cli-utf8-piped-input into stefankoegl:master

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@stefankoegl
stefankoegl merged commit 72e81d8 into stefankoegl:master Nov 28, 2026
26 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.

4 participants