3 ms·
Python also has this problem which you only find out once you're bitten by it. The encoding of all the built-in file manipulation machinery is platform specific
by Spivak 3y ago
Python also has this problem which you only find out once you're bitten by it. The encoding of all the built-in file manipulation machinery is platform specific so you either have to do `sys.setdefaultencoding("utf-8")` or add the encoding to every open call that uses text mode.
So kudos to every language that axes platform dependent encodings. Honestly platform dependent anything is so annoying to deal with. I would love if languages make it painfully explicit when you depend on platform defaults.
- rtpg 3y agoEven after Py2 -> Py3, the platform-dependent decoding sitting around for _so long_ was so annoying. Just constantly running into issues with file reads because servers were configured a certain way. "Just specify the encoding" is like... fine, but annoying when it's some third party script I just can't use. I'm at least glad we had some guarantees from being Python 3.