UTF-8 decoding error

Christian Maeder maeder at tzi.de
Wed Feb 8 06:18:21 EST 2006

Simon Marlow wrote:
> Christian Maeder wrote:
>> I'm tempted to replace "ä" bei "\228" in literals. What does haddock 
>> do with utf-8 in comments? Will DrIFT -- using read- and writeFile -- 
>> still work correctly?

The problem I fear is that writeFile does not produce a utf-8 encoded file:

writeFile "t.hs" "main = putStrLn \"äöüßÄÖÜ\""

Using "\228\246\252\223\196\214\220" instead of "äöüßÄÖÜ" only avoids 
conversion to utf-8 of the initial file l1.hs (attached), but the 
generated file t.hs is a latin-1 file in both cases.

Cheers Christian

*Main> :l l1.hs
Compiling Main             ( l1.hs, interpreted )
Ok, modules loaded: Main.
*Main> main
*Main> :l t.hs
Compiling Main             ( t.hs, interpreted )
Ok, modules loaded: Main.
*Main> main
-------------- next part --------------
A non-text attachment was scrubbed...
Name: l1.hs
Type: text/x-haskell
Size: 54 bytes
Desc: not available
Url : http://www.haskell.org//pipermail/glasgow-haskell-users/attachments/20060208/e2ff84f6/l1.bin

More information about the Glasgow-haskell-users mailing list