[prev in list] [next in list] [prev in thread] [next in thread]
List: haskell-cafe
Subject: [Haskell-cafe] Unicode strings
From: Pupeno <pupeno () pupeno ! com>
Date: 2006-11-05 18:17:07
Message-ID: 200611051817.13553.pupeno () pupeno ! com
[Download RAW message or body]
[Attachment #2 (multipart/mixed)]
Hello,
I am trying to make a program that outputs some Unicode characters but the
output doesn't match what I try to print.
Attached is a little test program. It tries to print the arrows "←↑→↓" but
instead it outputs "\220\221\222\223" (that is, character number 220, then
221, then 222). I've also tried writing the Unicode code points (although GHC
6.6 should deal just fine with Unicode source code) and I get the same
result. In case anybody wants to try, this would be the
string: "\8592\8593\8594\8595".
I am also attaching the output file, you can see that the contents are not
right.
Any ideas what am I doing wrong here ?
Thank you.
--
Pupeno <pupeno@pupeno.com> (http://pupeno.com)
["test.hs" (text/plain)]
import qualified System.IO as IO
main = do
let str = "←↑→↓"
putStrLn str
h <- IO.openFile "test.output" IO.WriteMode
IO.hPutStrLn h str
["test.output" (text/plain)]
[Attachment #7 (application/pgp-signature)]
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic