Chris Angelico <ros...@gmail.com>: > On Thu, Jul 17, 2014 at 12:39 AM, Marko Rauhamaa <ma...@pacujo.net> wrote: >> In other words, the well-meaning Python3 blindly obeys the locale even >> though I "simply stipulated" that my input is UTF-8. > > Except that you didn't - that input was not UTF-8. When you put a text > string as redirected input and then change LANG, you're lying to the > system, and you deserve all you get. Why are you even doing this, > other than to be able to point and laugh at programs that do the wrong > thing - when you've instructed them wrongly?
The example was artificial to make it small enough. The point is, though, that it is dangerous to assume that the file formats agree with the locale. Marko -- https://mail.python.org/mailman/listinfo/python-list