Non-ASCII line input does not work with the Haskeline backend.
The main issue is that Haskeline processes Unicode input and returns decoded Chars,
but the non-Haskeline backend uses getLine which reads each byte into a separate
Char. Darcs stores strings internally using the latter scheme, since it uses
standard library functions like writeFile, putStr, etc. which ignore all but the
lowest 8 bits of each Char.
For example (with a UTF-8 console):
Prelude> getLine
[user input:]α
"\206\177"
Prelude> :m +System.Console.Haskeline
Prelude System.Console.Haskeline> runInputT defaultSettings $ getInputLine ""
[user input:]α
Just "\945"
Also, Haskeline requires UTF-8 on Unix, which may be unnecessarily restrictive for
systems that use ISO-8859 and other such encodings.
The next release of Haskeline (version 0.6) should provide functionality which will
make these issues easier to resolve.
|