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

Curt Sampson cjs at starling-software.com
Sun Oct 25 00:01:57 EDT 2009

On 2009-10-24 19:03 -0700 (Sat), Philippos Apolinarius wrote:

> However, I do not know what I should do to solve it.

I am not clear on exactly what your requirements are as far as character
encodings. But you need to understand character encodings if you're
going to be using non-ASCII ones. One simple solution, if you have an
ISO-8859-1 ("latin1") file and you need a UTF-8 file is:

    iconv -f ISO-8859-1 -t UTF-8 input.hs output.hs

> I mean, Haskell is the only language  where I cannot type a common
> word like "façade" without running into trouble.

Actually, you would be having the exact same issues with Java; in UTF-8
mode it would also choke on Latin-1. I suspect that with your particular
implementation of Clean, you just happen to be generating the character
encoding that it uses as the default for input. Blaming Haskell for this
"problem" is quite unfair.

(If all of this UTF-8 stuff seems annoying to you, consider that in
ISO-8859-1 it's not possible to express the simplest Japanese word.
So moving from ISO-8859-1 to UTF-8 is done in the same spirit that
we long ago started using ISO-8859-1 instead of ASCII, so that you
could type "façade" instead of "facade.")

Curt Sampson       <cjs at starling-software.com>        +81 90 7737 2974
           Functional programming in all senses of the word:

More information about the Haskell-Cafe mailing list