Replies: 1 comment 2 replies
-
|
Hi! This is an encoding issue on Windows. The AWS CLI expects JSON input files to be UTF-8, but Fix reading
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm using aws cli v2.27.22 under Windows 10 "cmd" and am facing encoding issues when I export and import QuickSight dashboard definitions with it.
Here is the command I use to export:
With this, I get a json file encoded as CP1252 which is not what I want as everything I deal with is UTF-8. Now, looking at this issue comment, I made sure to call
set PYTHONUTF8=1before running that command and it then gives me a UTF-8 encoded file.This, in itself is a mild annoyance but it can be worked around.
However, when I want to create a dashboard using the CLI and giving all the arguments in a UTF-8 encoded file via
cli-input-json, it tries to encode the content into UTF-8 a second time, effectively destroying the content. Here is a command that I use:Using the same environment variable as above does not change the situation at all, nor using
PYTHONIOENCODING=UTF-8, and I could not find any way to tell the CLI to simply never try to UTF-8 encode the input file contents.Running the same commands under WSL2 makes all encoding issues disappear, but it's not always a possible solution, nor is changing the entire operating system parameters. That last one is especially problematic where company wide policies prevent access to those options.
When reading from the console input, I can understand the need to encode special characters, but there is no need to do so when reading the entire arguments from an external file, especially when it is a requirement that it is UTF-8 encoded.
What else can I try?
Beta Was this translation helpful? Give feedback.
All reactions