text icon indicating copy to clipboard operation
text copied to clipboard

add Latin1 encoder for use with HTTP headers

Open eamsden opened this issue 3 years ago • 0 comments

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.

eamsden avatar Apr 01 '21 11:04 eamsden