[Haskell-cafe] A 3 line program --> Reid, Don, Daniel

Ketil Malde ketil at malde.org
Sun Oct 25 17:06:51 EDT 2009


Philippos Apolinarius <phi500ac at yahoo.ca> writes:

> Thank you for your help. I am sure that you are right as to the cause
> of the problem.  However, I do not know what I should do to solve
> it. The Haskell program is generated by LaTeX macros.  It is useless
> to import System.IO.UTF8. I did it.

Are you sure?  It works for me (GHC 6.10 as shipped with Ubuntu 9.10).

> module Main where
> main = putStrLn "façade"

This will, with source in UTF8, output 0xe7 for the c-cedilla, which I
believe is ISO-8859-1.  Changing the source to

> module Main where
> import System.IO.UTF8 as U
> main = U.putStrLn "façade"

Gives the following expected, and utf-8-correct output:

  % ./utf | od -t a -t x1   
  0000000   f   a   C   '   a   d   e  nl
           66  61  c3  a7  61  64  65  0a
  0000010

-k
-- 
If I haven't seen further, it is by standing in the footprints of giants


More information about the Haskell-Cafe mailing list