On 2006-10-23, Jiba <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I am desperately searching for the encoding of sys.argv.
>
> I use a Linux box, with French UTF-8 locales and an UTF-8
> filesystem. sys.getdefaultencoding() is "ascii" and
> sys.getfilesystemencoding() is "utf-8". However, sys.argv is
> neither in ASCII (since I can pass French accentuated
> character), nor in UTF-8. It seems to be encoded in "latin-1",
> but why ?

It will most likely be in the encoding of the terminal from which
you call Python, in other words, sys.stdin.encoding.  Your only
hope of accepting non-US-ASCII command line arguments in this
manner is that sys.stdin.encoding is divined correctly by Python.

-- 
Neil Cerutti
Facts are stupid things. --Ronald Reagan
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to