
Hi, i experiment problems writing files. Reading an access 97 database and displaying data in a wxhaskell grid, everything is correct. When i write data in a text file, some characters are translated : "é" becomes \233. How to correct this ? I looked for hSetEncoding but didn't find it in System.IO, nor in GHC.IO.Handle that doesn't exist on my system. I tried hSetBinaryMode, without success. If this helps, I run ghc 6.10.4 on windows XP. Thanks for an idea, Didier.

Am Mittwoch 07 April 2010 22:39:39 schrieb legajid:
Hi,
i experiment problems writing files. Reading an access 97 database and displaying data in a wxhaskell grid, everything is correct. When i write data in a text file, some characters are translated : "é" becomes \233.
How to correct this ? I looked for hSetEncoding but didn't find it in System.IO, nor in GHC.IO.Handle that doesn't exist on my system. I tried hSetBinaryMode, without success.
Try import qualified System.IO.UTF8 as U and replace putStrLn, hPutStrLn, writeFile, appendFile, ... with U.putStrLn, U.hPutStrLn, ...
If this helps, I run ghc 6.10.4 on windows XP.
Thanks for an idea, Didier.

This is because of Unicode strings. You need to import
"Codec.Binary.UTF8.String" and use:
decodeString :: String -> String
and
encodeString :: String -> String
hth,
deech
On 4/7/10, legajid
Hi,
i experiment problems writing files. Reading an access 97 database and displaying data in a wxhaskell grid, everything is correct. When i write data in a text file, some characters are translated : "é" becomes \233.
How to correct this ? I looked for hSetEncoding but didn't find it in System.IO, nor in GHC.IO.Handle that doesn't exist on my system. I tried hSetBinaryMode, without success.
If this helps, I run ghc 6.10.4 on windows XP.
Thanks for an idea, Didier.
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

Hi, i've found another solution : instead of putStr (show text), i just write putStr text. As a remaining problem, i don't how to install cabal in order to install the desired module. Thanks, Didier. aditya siram a écrit :
This is because of Unicode strings. You need to import "Codec.Binary.UTF8.String" and use: decodeString :: String -> String and encodeString :: String -> String
hth, deech
On 4/7/10, legajid
wrote: Hi,
i experiment problems writing files. Reading an access 97 database and displaying data in a wxhaskell grid, everything is correct. When i write data in a text file, some characters are translated : "é" becomes \233.
How to correct this ? I looked for hSetEncoding but didn't find it in System.IO, nor in GHC.IO.Handle that doesn't exist on my system. I tried hSetBinaryMode, without success.
If this helps, I run ghc 6.10.4 on windows XP.
Thanks for an idea, Didier.
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

To install it (or any other module) I usually look up the module on Hayoo [1]. It will tell you the source package. In this case it is 'utf8-string' so just do:
cabal install utf8-string.
-deech
[1] http://holumbus.fh-wedel.de/hayoo/hayoo.html
On 4/8/10, legajid
Hi, i've found another solution : instead of putStr (show text), i just write putStr text.
As a remaining problem, i don't how to install cabal in order to install the desired module.
Thanks, Didier.
aditya siram a écrit :
This is because of Unicode strings. You need to import "Codec.Binary.UTF8.String" and use: decodeString :: String -> String and encodeString :: String -> String
hth, deech
On 4/7/10, legajid
wrote: Hi,
i experiment problems writing files. Reading an access 97 database and displaying data in a wxhaskell grid, everything is correct. When i write data in a text file, some characters are translated : "é" becomes \233.
How to correct this ? I looked for hSetEncoding but didn't find it in System.IO, nor in GHC.IO.Handle that doesn't exist on my system. I tried hSetBinaryMode, without success.
If this helps, I run ghc 6.10.4 on windows XP.
Thanks for an idea, Didier.
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

Am Donnerstag 08 April 2010 21:26:56 schrieb legajid:
Hi, i've found another solution : instead of putStr (show text), i just write putStr text.
Ah, yes, the Show instance escapes all characters beyond '\DEL', so (show text) doesn't contain any accented letters.
As a remaining problem, i don't how to install cabal in order to install the desired module.
For Windows, there should be a cabal binary somewhere (try http://www.haskell.org/cabal/download.html ). There is supposed to be one included in the Haskell Platform, so installing that might be a good move.
Thanks, Didier.
participants (3)
-
aditya siram
-
Daniel Fischer
-
legajid