3 ms·
> If you're happy with Go's "everything is a unicode string" approach then you should be happy to just treat everything as unicode. Don't handle the decode err
by the_mitsuhiko 13y ago
> If you're happy with Go's "everything is a unicode string" approach then you should be happy to just treat everything as unicode. Don't handle the decode errors - if someone sends some data to your stdin that's not in the correct encoding, too bad.
Go's approach is transparently passing data through. In Python 3 your process crashes if you do that.
- lmm 13y agoIn my book crashing is better than silently corrupting your data, which is what you'd get if you concatenated two files with different encodings the Go way.
- the_mitsuhiko 13y agoThe idea that data corruption happens is wrong though. There is no data corruption, at least not less than in Python 2 now that we have surrogate escape printing support in some cases. The only way to avoid data corruption is to be explicit about encodings which in 2.x is easy and in 3.x is almost as easy except if you want to work with stdout/stdin.
- suzuki 13y agoI totally agree. The transparency of 2.x & Go wins. Python 3.x is a disaster for me, a Unix user in Japan.