Feb. 13, 2012
5:49 a.m.
Greg Ewing writes:
Paul Moore wrote:
I'd like to write code to do the same job without needing to lie about what I know. I'm now 100% convinced that encoding="ascii",errors="surrogateescape" is the way to say this in code.
Perhaps there should be a more shortwinded way of spelling this?
Yes! However, I don't think this 1.5-liner needs to be a built-in. (The 1.5-liner for 'open_as_ascii_compatible' was posted elsewhere.) There's also the issue of people who strongly prefer sloppy encoding and Read My Lips: No UnicodeErrors. I disagree with them in all purity, but you know ....