Gustavo Niemeyer wrote:
[...]
The idiom presented by Bob is the right way to go: wrap
sys.stdout with a StreamWriter.
I don't see that as a good solution, since every Python software
that is internationalizaed will have do figure out this wrapping,
introducing extra overhead unnecessarily.
I don't
Gustavo Niemeyer wrote:
Hello Walter,
I don't see that as a good solution, since every Python software
that is internationalizaed will have do figure out this wrapping,
introducing extra overhead unnecessarily.
This wrapping is probably necessary for stateful encodings. If you
had a sys.stdout.enco
Hello Walter,
> >I don't see that as a good solution, since every Python software
> >that is internationalizaed will have do figure out this wrapping,
> >introducing extra overhead unnecessarily.
>
> This wrapping is probably necessary for stateful encodings. If you
> had a sys.stdout.encoding=="
Gustavo Niemeyer wrote:
[...]
You are mixing things here:
The source encoding is meant for the
parser and defines the way Unicode literals are converted
into Unicode objects.
The encoding used on the stdout stream doesn't have anything
to do with the source code encoding and has to be handled
diffe
[...]
> You are mixing things here:
>
> The source encoding is meant for the
> parser and defines the way Unicode literals are converted
> into Unicode objects.
>
> The encoding used on the stdout stream doesn't have anything
> to do with the source code encoding and has to be handled
> different
> Gustavo Niemeyer wrote:
> >Given the fact that files have an 'encoding' parameter, and that
> >any unicode strings with characters not in the 0-127 range will
> >raise an exception if being written to files, isn't it reasonable
> >to respect the 'encoding' attribute whenever writing data to a
> >
Hello Bob,
[...]
> >Given the fact that files have an 'encoding' parameter, and that
> >any unicode strings with characters not in the 0-127 range will
> >raise an exception if being written to files, isn't it reasonable
> >to respect the 'encoding' attribute whenever writing data to a
> >file?
>
Gustavo Niemeyer wrote:
Greetings,
Today, while trying to internationalize a program I'm working on,
I found an interesting side-effect of how we're dealing with
encoding of unicode strings while being written to files.
Suppose the following example:
# -*- encoding: iso-8859-1 -*-
print u"á"
Th
Gustavo Niemeyer wrote:
Given the fact that files have an 'encoding' parameter, and that
any unicode strings with characters not in the 0-127 range will
raise an exception if being written to files, isn't it reasonable
to respect the 'encoding' attribute whenever writing data to a
file?
In general,
On Nov 29, 2004, at 2:04 PM, Gustavo Niemeyer wrote:
Today, while trying to internationalize a program I'm working on,
I found an interesting side-effect of how we're dealing with
encoding of unicode strings while being written to files.
Suppose the following example:
# -*- encoding: iso-8859-1 -
Greetings,
Today, while trying to internationalize a program I'm working on,
I found an interesting side-effect of how we're dealing with
encoding of unicode strings while being written to files.
Suppose the following example:
# -*- encoding: iso-8859-1 -*-
print u"á"
This will correctly pr
11 matches
Mail list logo