Re: [PATCH 9/9] remote-curl: reencode http error messages
- From
Peter Krefting <peter@softwolves.pp.se>
- Date
- May 22, 2014, 07:26 UTC
- Message-ID
- <alpine.DEB.2.00.1405220816050.10958@ds9.cixit.se>
- In-Reply-To
- <EF689296-BB9E-4734-A044-25DEF1874884@gmail.com>
Kyle J. McKay:
Show 5 quoted lines
>> + if (!*charset)
>> + *charset = xstrdup("iso8859-1");
>
> Actually the name should be "ISO-8859-1". See RFC 2616 section 3.7.1. Since
> it's case insensitive "iso-8859-1" would be fine too.You'd be amazed at what you see in the wild... I'd recommend going with the recommended algorithm from WHATWG's Encoding Standard, if you want to make this robust: <http://encoding.spec.whatwg.org/#names-and-labels>.
The spec is partly based on a lot of research I made in my previous $DAYJOB, with a lot of research added by the spec writer.
There is also Unicode's attempt at it, but it does unfortunately produce too many false positives: <http://www.unicode.org/reports/tr22/tr22-7.html#Charset_Alias_Matching>
-- \\// Peter - http://www.softwolves.pp.se/