sed on the environment.
Just a related question, is looking at sys.stdin.encoding the proper
way of doing things? I've been working on a script to display some
email headers, some of which are encoded in MIME to various charsets.
Until now I have used whatever locale.getdefaultlocale() returns as
, Feb 11 2010, 00:51:29)
> > [GCC 4.2.1 (Apple Inc. build 5646)] on darwin
> > Type "help", "copyright", "credits" or "license" for more information.
> >>>> import sys;print sys.stdin.encoding
> > UTF-8
> >>>> ^
arwin
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import sys;print sys.stdin.encoding
> UTF-8
>>>> ^D
> [...@mickey:~]$ echo 'import sys;print sys.stdin.encoding' | python
> None
&
ts" or "license" for more information.
>>> import sys;print sys.stdin.encoding
UTF-8
>>> ^D
[...@mickey:~]$ echo 'import sys;print sys.stdin.encoding' | python
None
[...@mickey:~]$
And indeed, trying to pipe unicode into Python doesn't work, even though
it
Leo Kislov schrieb:
> Environmental variable TERMENCODING ? Heck, maybe this will catch on
> and will be used by other languages, libraries, terminals, etc. It's
> not really Python only problem.
I also considered environment variables. This can likely be made
available only in 2.6, though.
Plus,
Martin v. Löwis wrote:
> [EMAIL PROTECTED] schrieb:
> > The following line in my code is failing because sys.stdin.encoding is
> > Null. This has only started happening since I started working with
> > Pydef in Eclipse SDK. Any ideas?
> >
> > uni=unicode(word
[EMAIL PROTECTED] wrote:
> Duncan Booth skrev:
>
> > [EMAIL PROTECTED] wrote:
> >
> > > The following line in my code is failing because sys.stdin.encoding is
> > > Null.
> >
> > I'll guess you mean None rather than Null.
> >
> &g
Duncan Booth skrev:
> [EMAIL PROTECTED] wrote:
>
> > The call to sys.getdefaultencoding() returns ascii. Since I can enter
> > the characters åöä on the command line in Pydef/Eclipse doesn't that
> > mean that the stdin is not ascii? What should I do?
> >
> I think that depends on what sort of sc
[EMAIL PROTECTED] wrote:
> The call to sys.getdefaultencoding() returns ascii. Since I can enter
> the characters åöä on the command line in Pydef/Eclipse doesn't that
> mean that the stdin is not ascii? What should I do?
>
I think that depends on what sort of script you are writing.
If it is ju
[EMAIL PROTECTED] schrieb:
> The following line in my code is failing because sys.stdin.encoding is
> Null. This has only started happening since I started working with
> Pydef in Eclipse SDK. Any ideas?
>
> uni=unicode(word,sys.stdin.encoding)
That's a problem with pydev
Duncan Booth skrev:
> [EMAIL PROTECTED] wrote:
>
> > The following line in my code is failing because sys.stdin.encoding is
> > Null.
>
> I'll guess you mean None rather than Null.
>
> > This has only started happening since I started working with
> >
[EMAIL PROTECTED] wrote:
> The following line in my code is failing because sys.stdin.encoding is
> Null.
I'll guess you mean None rather than Null.
> This has only started happening since I started working with
> Pydef in Eclipse SDK. Any ideas?
>
> uni=unicode(word,sys
The following line in my code is failing because sys.stdin.encoding is
Null. This has only started happening since I started working with
Pydef in Eclipse SDK. Any ideas?
uni=unicode(word,sys.stdin.encoding)
Thanks,
Aine.
--
http://mail.python.org/mailman/listinfo/python-list
13 matches
Mail list logo