MC wrote:
> Hi!
>
> On win-XP (french), when I read subprocess (stdout), I must use
> differents decoding (cp1252,cp850,cp437, or no decoding), depending of
> the "launch mode" of the same Python's script:
>   - from command-line
>   - from start+run
>   - from icon
>   - by Python-COM-server
>   - etc.
>
> (.py & .pyw can also contribute)
>
>
> How to know, on the fly, the encoding used by subprocess?

You can't. Consider a Windows equivalent of UNIX "cat" program. It just
dump content of a file to stdout. So the problem of finding out the
encoding of stdout is equal to finding out encoding of any file. It's
just impossible to do in general. Now, you maybe talking about
conventions. AFAIK since Windows doesn't have strong command line
culture, it doesn't such conventions.

  -- Leo

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to