T
Tomasz Toczyski
My locale is set to UTF-8. The command:
python -c "print u'\u03A9'"
gives me the desired result and doesn't produce any error.
But when I want to redirect the output to a file I invoke:
python -c "print u'\u03A9'" > file.txt
I get an error:
File "<string>", line 1, in <module>
UnicodeEncodeError: 'ascii' codec can't encode character u'\u03a9' in
position 0: ordinal not in range(128)
How to cope with it?
-tt.
python -c "print u'\u03A9'"
gives me the desired result and doesn't produce any error.
But when I want to redirect the output to a file I invoke:
python -c "print u'\u03A9'" > file.txt
I get an error:
File "<string>", line 1, in <module>
UnicodeEncodeError: 'ascii' codec can't encode character u'\u03a9' in
position 0: ordinal not in range(128)
How to cope with it?
-tt.