By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,678 Members | 1,175 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,678 IT Pros & Developers. It's quick & easy.

text encodings -> subprocess.Popen or -> labelmarkup (pygtk)

P: n/a
Hi all,

first of all, I have to say I have hardly no knowledge about that
issue.

on the program there, I have it like that:
,-------------------------------------------------------
| obj = unicode(newcomment, 'utf-8')
| newcomment = obj.encode('latin-1')
|
| pipe = subprocess.Popen(tot, stdout=subprocess.PIPE,\
| stderr=subprocess.PIPE, shell=False)
`---

that seems to work with that construction above.

Then I think, 'what' kind of encoding I can send to an external program,
depends also on that program? Or on the environment? If, then how could
I get that environemnt? (the programs runs also under MS windows)

Well, maybe someone has some hints about encodings issues like that, and
what I can send to external commands?

thanks a lot
calmar

--
calmar

(o_ It rocks: LINUX + Command-Line-Interface
//\
V_/_ http://www.calmar.ws
Feb 16 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"calmar" wrote:
Then I think, 'what' kind of encoding I can send to an external program,
depends also on that program?


the encoding is a mapping between raw bytes and their actual meaning,
and a program usually only sees the bytes, so it's entirely up to the pro-
gram to interpret what you send to it.

many programs defaults to the system's "global" default encoding for text
input; you can use the "getpreferredencoding" function in the locale module
to figure out what it is set to:

http://docs.python.org/lib/module-locale.html

</F>

Feb 16 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.