I wish to grab an input text using the IO functionality of Data.Text
. My quandry has to do with encoding discovery. That is, if I am not aware of the encoding of the text before-hand, how is the IO in Data.Text
of any use at all in situations where the encoding of the text being read is different than the system locale setting? Is there an encoding discovery mechanism somewhere in Data.Text
?
I know I might get a bunch of responses that say "use Data.ByteString
", but wasn't Data.Text
created for the purpose of getting away from the use of Data.ByteString
for reading text?
Also, if I must use Data.ByteString
, does anyone know what happens when octets 0x80 to 0x9f are read? Are they read in as expected like the rest of the input? They are undefined in ISO-8859-1, and Data.ByteString
's IO seems to indicate that input is treated as if the source is ISO-8859-1.