Just a tip for those who are only just cutting their teeth on Python 3.0
and might have encountered the same problem as I did:
When a Python (3.x) program is run on a terminal that only supports a
legacy character encoding - such as Latin 1 or Codepage 437 - all
characters printed to stdout wi
Terry Reedy wrote:
If the terminal expects cp437 then displaying utf-8 might give some
problems.
My screen displays whatever Windows tells the graphics card to tell
the screen to display. In OpenOffice, I can select a unicode font
that displays at least everything in the BasicMultilingualPla
John Nagle wrote:
Python 5 is even stricter. Only ASCII (chars 0..127) can be sent
to standard output by default.
Python 5? (I guess I haven't been following these things enough...)
Well, I would sure hope not.
--
znark
--
http://mail.python.org/mailman/listinfo/python-list
When converting Unicode strings to legacy character encodings, it is
possible to register a custom error handler that will catch and process
all code points that do not have a direct equivalent in the target
encoding (as described in PEP 293).
The thing to note here is that the error handler it
Serge Orlov wrote:
>> # So the question becomes: how can I make this work
>> # in a graceful manner?
> change the return statement with this code:
>
> return (substitution.encode(error.encoding,"practical").decode(
>error.encoding), error.start+1)
Thanks, that was a quite neat re