text
text copied to clipboard
add Latin1 encoder for use with HTTP headers
Presently there is a function Data.Text.Encoding.decodeLatin1 which decodes a ByteString as Latin1/ISO-8859-1 text to Text.
It would be very helpful to have a corresponding encodeLatin1 function to assist in writing HTTP header serialization in i.e. Servant.
This would obviously not be a total function as most of Unicode cannot be coded by Latin1, however, it could be made to either throw exceptions or return an Either value and still be very helpful.