Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > subprocess decoding?

Reply
Thread Tools

subprocess decoding?

 
 
MC
Guest
Posts: n/a
 
      10-28-2006
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


 
Reply With Quote
 
 
 
 
Leo Kislov
Guest
Posts: n/a
 
      10-30-2006

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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to import subprocess into my 'subprocess.py' file hiral Python 2 05-05-2010 12:56 PM
Process Runtime.exec causes subprocess hang. Nishi Bhonsle Java 2 11-30-2009 06:10 AM
[Subprocess/Windows] subprocess module under Windows 98 Andreas Jung Python 2 11-02-2005 05:41 PM
Running a subprocess on a "leash" Greg Kuperberg Python 1 10-08-2003 12:18 AM
Linux / how to check if subprocess is still alive Sigfried Manner C Programming 7 09-01-2003 05:59 PM



Advertisments