
17 Nov
2017
17 Nov
'17
4:38 a.m.
I have a LATIN-1 encoded file on a UTF-8 configured system: $ iconv -f latin1 Text Häßkell $ echo $LANG de_DE.UTF-8 Thus, a Haskell program cannot process it as it is: $ cat Text | ghc-8.2.2 -e 'interact id' | iconv -f latin1 <interactive>: <stdin>: hGetContents: invalid argument (invalid byte sequence) So far, so expected. Now I want to run it with latin encoding: $ cat Text | (LANG=de_DE ghc-8.2.2 -e 'interact id') | iconv -f latin1 <interactive>: <stdin>: hGetContents: invalid argument (invalid byte sequence) That's unexpected. Is this the reason: $ LANG=de_DE ghc-8.2.2 -e 'print System.IO.localeEncoding' ASCII ? Btw. what would be the Locale name for Latin-1 encoding?