Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I force AWS CLI to use UTF encoding?

I'm using AWS CLI on Windows to query items from DynamoDb. Some of these items include non-ASCII characters.

When the query hits those items, it dies with an error

'charmap' codec can't encode character u'u010d' in position....

After hours of searching, I finally stumbled across a hackish workaround; under the AWSCLI\encodings directory, I copied utf_8.pyc over cp1252.pyc. This allows me to continue, but of course is ugly.

Before resorting to that, I also tried setting environment variables such as LANG, LC_ALL, LC_CTYPE to various permutations of en-US.UTF-8 or similar, all with no effect that I could see.

Does anyone know how (or is it even possible) to tell AWS CLI to use a particular encoding?

like image 595
Rick Riensche Avatar asked Sep 02 '16 22:09

Rick Riensche


1 Answers

I am using git bash on windows 10 and set PYTHONIOENCODING=UTF-8 was not actually did env change. Used export PYTHONIOENCODING=UTF-8 then overcame the charmap error

like image 199
John Du Avatar answered Sep 17 '22 20:09

John Du