-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'charmap' codec can't encode character error from AWS CLI #8283
Comments
Issues #7985 seems to be describing similar problem with character encoding. Thanks, Daniil |
Hi @daivanov, thanks for reaching out. I was able to reproduce this issue and bypass it by changing my system locale (see this Stack Overflow thread) on Windows 10. Could you try that and let me know if it works for you? |
It doesn't work even, if I do things like this:
Thanks, Daniil |
My local Python has UTF-8 as a default encoding:
I don't have Python installed in Windows:
So this Python 3.11.6
must be bundled with AWS CLI and it has non UTF-8 default encoding. Thanks, Daniil |
Python in AWS CLI is clearly using CP1252 encoding
Thanks, Daniil |
AWS CLI does use the character encoding provided by the system. After reverting my system locale to reproduce the issue again, the environment variable that did the trick for me was |
Hi, Yes, that worked:
Thank you very much for this hint! Kind Regards, Daniil |
|
This solved the issue for me |
Describe the bug
I have aws cli:
$ aws --version
aws-cli/2.13.30 Python/3.11.6 Windows/10 exe/AMD64 prompt/off
And this python must be bundled with AWS CLI as my own Python is older:
$ python -V
Python 3.9.16
I defined all possible variables people talk on the internet:
$ env | grep -i UTF
LANGUAGE=en_US.UTF-8
LANG=en_US.UTF-8
PYTHONIOENCODING=UTF-8
LC_CTYPE=en_US.UTF-8
LC_ALL=en_US.UTF-8
When execute:
$ aws servicecatalog describe-product --id prod-6f5mpi6ncyfjk
Expected Behavior
No errors on non-ASCII characters
Current Behavior
I'm getting an error and aws cli halts
'charmap' codec can't encode character '\u0144' in position 25: character maps to
Reproduction Steps
Create products in AWS with non-ASCII characters in the description and try
aws servicecatalog describe-product
Possible Solution
No response
Additional Information/Context
No response
CLI version used
aws-cli/2.13.30 Python/3.11.6 Windows/10 exe/AMD64 prompt/off
Environment details (OS name and version, etc.)
Windows 10, cygwin 3.4.9-1, bash 5.2.15-3
The text was updated successfully, but these errors were encountered: