[Python-ideas] Why decode()/encode() name is harmful

Chris Angelico rosuav at gmail.com
Fri May 29 17:57:53 CEST 2015


On Fri, May 29, 2015 at 6:56 PM, anatoly techtonik <techtonik at gmail.com> wrote:
> Then he tries to read the documentation, it
> already starts to bring conflict to his mind. It says
> to him to "decode" the text. I don't know about you,
> but when I'm being told to decode the text, I
> assume that it is crypted, because I watched a
> few spy movies including ones with Sherlock
> Holmes and Stierlitz. But the text looks legit to me,
> I can clearly see and read it and now you say that
> I need to decode it.

This is because you fundamentally do not understand the difference
between bytes and text. Consequently, you are trying to shoehorn new
knowledge into your preconceived idea that the file *already contains
text*, which is not true.

Go read:
http://www.joelonsoftware.com/articles/Unicode.html
http://nedbatchelder.com/text/unipain.html

Also, why is this on python-ideas? Talk about this sort of thing on python-list.

ChrisA


More information about the Python-ideas mailing list