4 ms·
That was the main reason I migrated: processing everything internally in Unicode and then encoding/decoding as needed for the outside world creates a well defin
by fb03 10y ago
That was the main reason I migrated: processing everything internally in Unicode and then encoding/decoding as needed for the outside world creates a well defined 'place-where-unicode-shit-might-bork' border in your project that allows you to not only detect unicode errors earlier, as you stated, but also keep tabs on this 'border'.... eventually you don't even have unicodeerrors in your codebase anymore, because in 3.x this pattern emerges in your head and imho it's a really good thing, it is making your think properly how your code interacts with other entities.
- dom0 10y agoFTR I can't remember ever seeing a UnicodeError in Python 3 that was caused by an ill-formed program. I only saw it when someone put binary shit somewhere were only text should be (eg. that flat text file with the page title should contain text, not an .exe) Also the distinction between binary and text is the only sane way to handle it. Everything else is simply ill-formed.