Since the latin-1 (aka ISO-8859-1) character set is embedded in the Unicode character set as its lowest 256 code-points, I'd expect the conversion to be trivial, but I didn't see any latin-1 encoding conversion functions in Data.Text.Encoding
which contains only conversion functions for the common UTF encodings.
What's the recommended and/or efficient way to convert between Data.ByteString
values encoded in latin-1 representation and Data.Text
values?
Data.Text
used utf8 as its internal Unicode representation), but the current version of theData.Text
library uses UTF16 representation, for which the conversion from latin1 is in fact a trivial conversion consisting in inserting zero octets after or before (depending on whether UTF16LE or UTF16BE is required) each latin1 octet. – Triatomic