Troubleshooting Unicode Errors in the CLI

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

C:\Users\Lara>Python necli.py --host 192.168.202.194 --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 June 21, 2019, at 02:49:49 PM.

Eggplant icon Eggplantsoftware.com | Documentation Home | User Forums | Support | Copyright © 2020 Eggplant