[darcs-users] haskeline and character encodings

Judah Jacobson judah.jacobson at gmail.com
Thu Feb 5 18:58:39 UTC 2009

On Thu, Feb 5, 2009 at 9:53 AM, Eric Kow <kowey at darcs.net> wrote:
> Hi Judah,
> Just a quick question about haskeline.  I notice it uses iconv (and if I
> remember correctly, gives us UTF-8 characters).
> Any implications for our current character encoding woes?
>  http://bugs.darcs.net/issue64

The way that Haskeline is currently used in Darcs should not change
its encoding behavior at all.  (In fact, Darcs still gets 8-bit Chars
in whatever encoding the console is set to.)

However, Haskeline does provide extra functionality to help with

 - All the functions from System.Console.Haskeline (for both input and
output) automatically convert the console's encoding to/from decoded
(i.e, 32-bit) Unicode Chars.
 - The module System.Console.Haskeline.Encoding exports functions
converting to/from the console locale.

So for console input and printing, Haskeline can provide what you
need, although its behavior when printing unencodable Chars might need
to be improved slightly.  (Currently, it drops them from the output.)


More information about the darcs-users mailing list