On 19 January 2005 05:31, John Meacham wrote:

> A while ago I wrote a glibc specific implementation of the CWString
> library. I have since made several improvements:
> 
> * No longer glibc specific, should compile and work on any system with
>   iconv (which is unix standard) (but there are still glibc specific
>   optimizations)
> * general iconv library for conversion to any other supported
>   character sets
> * LocaleIO, a plug in replacement for many of the standard prelude and
>   IO calls which transparently handle locale encoding.
> 
> and best of all, it now has a darcs repository.
> 
>  http://repetae.net/john/recent/out/HsLocale.html
> 
> It could still using some fleshing out, LocaleIO is still incomplete,
> I add to it as I need a function,  but I figure I should make it
> available in case the CWString stuff came in handy for implementing
> the FFI spec for ghc.

I'd like to get a correct CString implementation into GHC's libraries.
I think the CWString implementation we have now is good enough, but
CString should be doing locale encoding/decoding (as you know).  At the
same time, we should check all the withCString calls to see whether they
should really be withCAString (since withCString is about to get quite a
bit slower).

Would you be interested in helping with this, or even putting together a
patch?  It's probably too late for 6.4, though.

> PS. is there a way to replace the top level error handler in ghc?
> (from a haskell library) I'd like to be able to print the error
> messages with the LocaleIO library as it is the only place where the
> wrong encoding still can leak out.

There's no way to replace the handler, I'm afraid.

Cheers,
        Simon
_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to