Troubleshooting Unicode Errors in the CLI

Sometimes (particularly on Windows) you might see errors similar to this:

C:\Users\Lara>Python --host --user admin --password admin -getVersion

--error "charmap' codec can't encode character '\u2013' in position 17: character maps to <undefined>"

If you look carefully, there is only one - in front of getVersion (even though you’re convinced you typed two of them) so this appears to be the problem. You therefore add another and get exactly the same error.

What might have happened here is that, while documenting in Microsoft Word, it changed your original --getVersion (minus minus getVersion) into –getVersion (long dash getVersion) because this looks nicer to read. A long dash is not an ascii (7 bit or 8 bit) character and has the Unicode value of 2013, hence the error message. To fix it, make sure you’re using two short dashes.


This topic was last updated on August 19, 2021, at 03:30:51 PM.

Eggplant icon | Documentation Home | User Forums | Support | Copyright © 2022 Eggplant