On Fri, Jan 22, 2016 at 11:56 PM, Nigel Tao <
nige...@golang.org> wrote:
> On Sat, Jan 23, 2016 at 8:58 AM, Manlio Perillo
> <
manlio....@gmail.com> wrote:
>> What is the reason?
>>
>> ...
>>
>> I suspect that whatwg consider ISO-8859-1 as an alias for Windows-1252 for
>> this reason. x/text should not follow whatwg, IMHO.
>
> Yes, the reason is that WHATWG says to do so. There is some sense that
> the wonderful thing about standards is that there are so many of them
> to choose from, but we did have to choose one, and we chose WHATWG,
> since billions of people use web browsers and e-mail clients, and e.g.
> Go is often used to write web clients and servers.
>
This is simply wrong, IMHO.
If you want to use Windows-1252 for compatibility reasons, as
suggested by WHATWG, then it is your application responsibility to
define an encoding mapping that considers ISO-8859-1 an alias for
Windows-1252.
> IIUC, ISO-8859-1 is a subset of Windows-1252, so if you're only
> decoding and not encoding, and decoding assuming valid input, then
> your decoded output should be just fine anyway.
>
> Even if it isn't, it should be easy to write your own Encoding
> implementation with the exact semantics you want.
It can be easy, but I don't see why it should not be available from
the text package. I was surprised to found all the ISO-8859 encodings
except latin1.
Thanks Manlio