subprocess decoding?

Discussion in 'Python' started by MC, Oct 28, 2006.

  1. MC

    MC Guest

    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?


    Thanks by advance

    --
    @-salutations

    Michel Claveau
     
    MC, Oct 28, 2006
    #1
    1. Advertising

  2. MC

    Leo Kislov Guest

    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
     
    Leo Kislov, Oct 30, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ouadid abdelkarim
    Replies:
    0
    Views:
    2,020
    ouadid abdelkarim
    Jul 10, 2003
  2. Laurent Pinchart

    Address decoding

    Laurent Pinchart, Apr 11, 2004, in forum: VHDL
    Replies:
    3
    Views:
    6,377
    Jim Lewis
    Apr 12, 2004
  3. Bjorn Jensen
    Replies:
    2
    Views:
    831
    Bjorn Jensen
    Mar 22, 2005
  4. Martin Schimmelpfennig

    Data Decoding at 10 Gbit/s

    Martin Schimmelpfennig, Dec 21, 2005, in forum: VHDL
    Replies:
    4
    Views:
    2,677
    JosephKK
    Jan 2, 2006
  5. hiral
    Replies:
    2
    Views:
    614
    Jean-Michel Pichavant
    May 5, 2010
Loading...

Share This Page