Python 3.2 has some deadly infection
On 2 June 2014 17:45, Wolfgang Maier <
wolfgang.maier at biologie.uni-freiburg.de> wrote:
> Tim Delaney <timothy.c.delaney <at> gmail.com> writes:
> > For some purposes, there needs to be a way to treat an arbitrary stream
> bytes as an arbitrary stream of 8-bit characters. iso-latin-1 is a
> convenient way to do that.
> For that purpose, Python3 has the bytes() type. Read the data as is, then
> decode it to a string once you figured out its encoding.
I know that, you know that. Convincing other people of that is the
I probably should have mentioned it, but in my case it's not even Python
(Java). It's exactly the same principal - an assumption was made that has
become entrenched due to the fear of breakage. If they'd been forced to
think about encodings up-front, it shouldn't have been an issue, which was
the point I was trying to make.
In Java, it's much worse. At least with Python you can perform string-like
operations on bytes. In Java you have to convert it to characters before
you can really do anything with it, so people just use the default encoding
all the time - especially if they want the convenience of line-by-line
reading using BufferedReader ...
-------------- next part --------------
An HTML attachment was scrubbed...