[Haskell-cafe] getting crazy with character encoding

Jules Bean jules at jellybean.co.uk
Wed Sep 12 15:26:15 EDT 2007


David Benbennick wrote:
> On 9/12/07, Andrea Rossato <mailing_list at istitutocolli.org> wrote:
>> If I run it in a console I get
>> abA"A"A" (sort of) no matter what my LANG is - 8 single 8 -bit
>> characters.
> 
> It's possible to set your Linux console to grok UTF8.  I don't
> remember the details, but I'm sure you can Google for it.
> 
> By the way, does anyone know The Right Way to deal with UTF-8 in
> Haskell?  I.e., take that 8 byte UTF-8 string and convert it to a 5
> character Unicode string (so it can be manipulated)?


There is no UTF8 decode support in the standard libraries.

There are some contributed libraries which can do it. Data.CompactString 
is one.

Jules


More information about the Haskell-Cafe mailing list