UTF8 (was Re: Hexdump)

Bayley, Alistair Alistair_Bayley at ldn.invesco.com
Tue Mar 21 10:33:44 EST 2006


> From: libraries-bounces at haskell.org 
> [mailto:libraries-bounces at haskell.org] On Behalf Of Malcolm Wallace
> 
> I was also thinking it would be nice to have pure Haskell
> implementations of the various Unicode encodings.  Here is my 
> attempt at
> the UTF-8 codec.  Like Dominic, I am wondering where such a module
> should live in the hierarchy?
> 
>     Text.Codec.UTF8
>     Codec.Text.UTF8
>     Text.UTF8
>     Codec.UTF8
> 
> Regards,
>     Malcolm


My initial instinct is to put the UTF codecs in Foreign.C
(Foreign.C.Unicode, say, or Foreign.C.Codec), because I've only used
ever used them to marshall between Haskell Strings and CStrings. Also, a
bunch o' functions like withUTF8CString{Len}, peekUTF8CString, etc are
also useful.

OTOH, I can think of uses for non-CString oriented codecs (e.g.
converting an HTTP request body from a specific charset to Unicode), so
maybe this is a dumb idea.

Alistair
*****************************************************************
Confidentiality Note: The information contained in this message,
and any attachments, may contain confidential and/or privileged
material. It is intended solely for the person(s) or entity to
which it is addressed. Any review, retransmission, dissemination,
or taking of any action in reliance upon this information by
persons or entities other than the intended recipient(s) is
prohibited. If you received this in error, please contact the
sender and delete the material from any computer.
*****************************************************************


More information about the Libraries mailing list