Python under PowerShell adds characters

Steven D'Aprano steve at pearwood.info
Thu Mar 30 01:06:04 EDT 2017


On Thu, 30 Mar 2017 07:29:48 +0300, Marko Rauhamaa wrote:

[...]
> I'd expect not having to deal with Unicode
> decoding exceptions with arbitrary input.

That's just silly. If you have *arbitrary* bytes, not all byte-sequences 
are valid Unicode, so you have to expect decoding exceptions, if you're 
processing text.

Coming back to your complaint: Python 3 might default to automatically 
decoding stdin to Unicode, but you can choose to read stdin as bytes if 
you so wish.


> There recently was a related debate on the Guile mailing list. Like
> Python3, Guile2 is sensitive to illegal UTF-8 on the command line and in
> the standard streams. An emacs developer was urging Guile developers to
> follow emacs's example and support a superset of UTF-8 and Unicode where
> all byte strings can be bijectively mapped into text.

I'd like to read that. Got a link?



-- 
Steve



More information about the Python-list mailing list