I might be wrong, but it seems there is no module library in Haskell that would provide a unified interface for converting strings from one encoding into another, be it Unicode Transformation Formats, the numerous 8-bit encodings, or some user-defined transliterations or transcriptions. Inspired by the Encode module in Perl, I have sketched an architecture of such an interface for Haskell. Let me give links to the proto-implementation and its documentation: http://ckl.mff.cuni.cz/smrz/Encode-0.01.zip http://ckl.mff.cuni.cz/smrz/Encode/doc/index.html There, I further discuss and illustrate how extending the library with new encodings would be done, and what the common data representation type might be. I would be happy for your comments and suggestions. Thank you, Otakar Smrz
Otakar Smrz wrote:
[...] I would be happy for your comments and suggestions.
There were some extensive discussions about encoding/decoding on the libraries mailing list some time ago, but IIRC no real consensus was reached. Among the problems were * The interface to the encoded/decoded data: A list might be enough for toy applications, but probably not for serious ones. * What to do in case of errors during encoding/decoding? * How should stateful encodings be handled? etc. etc. Cheers, S.
On 2005-02-27, Otakar Smrz <smrz@ldc.upenn.edu> wrote:
I might be wrong, but it seems there is no module library in Haskell that would provide a unified interface for converting strings from one encoding into another, be it Unicode Transformation Formats, the numerous 8-bit encodings, or some user-defined transliterations or transcriptions.
Correct, though some rough drafts have been sketched.
http://ckl.mff.cuni.cz/smrz/Encode/doc/index.html
There, I further discuss and illustrate how extending the library with new encodings would be done, and what the common data representation type might be.
I would be happy for your comments and suggestions.
Well, the type you have as "Unicode" _is_ the Haskell Char type, according to the standard. None of the implementations use it properly, but ... What you have as lists of Chars is probably best done as lists of Word8s -- bytes. -- Aaron Denney -><-
participants (3)
-
Aaron Denney -
Otakar Smrz -
Sven Panne