Feb. 12, 2012
11:03 p.m.
Masklinn writes:
Or just use the ISO-8859-1 encoding.
It's true that requires to handle encodings upfront where Python 2 allowed you to play fast-and-lose though.
And using latin-1 in that context looks and feels weird/icky, the file is not encoded using latin-1, the encoding just happens to work to manipulate bytes as ascii text + non-ascii stuff.
So give latin-1 an additional name. Emacsen use "raw-text" (there's also binary, but raw-text will do a loose equivalent of universal newlines for you, binary doesn't). You could also use a name more exact and less English-biased like "ascii-compatible-bytes". Same codec, name denotes different semantics.