Re: UTF-8 encode/decode libraries.

2004-05-05 Thread Antti-Juhani Kaijanaho
On 20040426T104946-0700, David Brown wrote: > Is anyone aware of any Haskell libraries for doing UTF-8 decoding and > encoding? If not, I'll write something simple. I wrote a simple Unicode library for my MSc project a couple of years ago. It might not compile with recent GHC, but you can have a

Re: UTF-8 encode/decode libraries.

2004-04-26 Thread David Brown
On Mon, Apr 26, 2004 at 08:33:38PM +0200, Sven Panne wrote: > Duncan Coutts wrote: > >On Mon, 2004-04-26 at 18:49, David Brown wrote: [...] > >toUTF :: String -> String > > Hmmm, "String -> [Word8]" would be nicer... > > >fromUTF :: String -> String > > ... and here: "[Word8] -> String" or "[Wor

Re: UTF-8 encode/decode libraries.

2004-04-26 Thread Sven Panne
Duncan Coutts wrote: On Mon, 2004-04-26 at 18:49, David Brown wrote: [...] toUTF :: String -> String Hmmm, "String -> [Word8]" would be nicer... fromUTF :: String -> String ... and here: "[Word8] -> String" or "[Word8] -> Maybe String". Furthermore, UTF-8 is not restricted to a maximum of 3 bytes

Re: UTF-8 encode/decode libraries.

2004-04-26 Thread Duncan Coutts
On Mon, 2004-04-26 at 18:49, David Brown wrote: > Is anyone aware of any Haskell libraries for doing UTF-8 decoding and > encoding? If not, I'll write something simple. The gtk2hs library uses the following functions internally. Credit to Axel Simon I believe unless he swiped them from somewhere