Dear all,
I have a small script wich is supposed to process two images passed as arguments in commandline, but I don't know how to handle these arguments when they are with non latin characters.
Here is an example of command
python.exe myscrit.py --first=xvalue "image1.png" "οισξφσιο.png"
If I isolate the arguments as follows
import sys, getopt
opts, args = getopt.getopt(sys.argv[1:], '', ['first=']) opts = dict(opts)
fval_name = opts.get('--first', 'xvalue')
and I print the second args
I end up with a string like this ??s?fs??.png
.
What am I doing wrong and how can I fix it?
I also tried the following in my script but nothing seems to work
# -*- coding: UTF-8 -*-
from __future__ import unicode_literals
import sys, traceback
reload(sys)
sys.setdefaultencoding("utf-8")
Any help is appreciated.
Thanks,
giancan