How to read Unicode characters from command-line arguments in Python on Windows
- by Craig McQueen
I want my Python script to be able to read Unicode command line arguments in Windows. But it appears that sys.argv is a string encoded in some local encoding, rather than Unicode. How can I read the command line in full Unicode?
Example code: argv.py
import sys
first_arg = sys.argv[1]
print first_arg
print type(first_arg)
print…