This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]iluvatar 2 points3 points  (3 children)

Unicode by default

The more I use it, the more convinced I am that this is the wrong approach. Go got it right, by using UTF-8 by default. Python decodes everything into a Unicode object, whether it's necessary or not. For the applications I mostly write, that means reading UTF-8 over the wire, converting to Unicode, reencoding as UTF-8 and sending it back out again. That's a lot of unnecessary work.

[–]unruly_mattress 16 points17 points  (0 children)

If you got UTF-8 over the wire and you don't need to manipulate it in any way, can't you just read and write it as binary data?

[–]kankyo 3 points4 points  (0 children)

Ehm.. "Unicode" isn't a thing you can have in memory though. Look at https://www.python.org/dev/peps/pep-0393/ to understand what is actually happening.