kislyuk / yq

Command-line YAML, XML, TOML processor - jq wrapper for YAML/XML/TOML documents
https://kislyuk.github.io/yq/
Apache License 2.0
2.57k stars 82 forks source link

Wrong charset is used when reading stdin on Windows #142

Closed bergerst closed 2 years ago

bergerst commented 2 years ago

To reproduce:

  1. Execute echo 'test: Äöü' | yq on Windows
  2. The following is printed:
    {
    "test": "Äöü"
    }

The same bug happens when reading from an UTF-8 encoded file.

This prevents me from using it on Windows.

kislyuk commented 2 years ago

yq is completely agnostic to the encoding being used. We do not hardcode utf-8 (which you should use) anywhere in the codebase. The encoding to use is automatically selected by Python. I recommend that you check your system configuration to track which encoding is used by Python by default - I don't really have a good idea of how this is done on Windows, nor do I have any desire to find out. You might also consider using WSL.

kislyuk commented 2 years ago

I am going to close this issue for now as it does not appear to be a bug in yq. If you have specific suggestions for how to change yq's behavior to better accommodate your use case, please feel free to comment with a full reproduction of the expected vs. observed behavior (including the shell and Python distribution and version you are using) and we can re-open.