[Haskell] Re: ASCII higher than 127

Christian Maeder maeder at tzi.de
Tue Oct 17 11:01:48 EDT 2006


Either convert your file to utf-8 encoding or read

http://www.haskell.org/ghc/docs/6.6/html/users_guide/release-6-6.html

GHC now treats source files as UTF-8 (ASCII is a strict subset of UTF-8,
so ASCII source files will continue to work as before). However, invalid
UTF-8 sequences are ignored in comments, so ASCII code with comments in,
for example, Latin-1 will also work.

A way to have Latin-1 source files pre-processed by GHC is described in
Section 4.10.4, "Options affecting a Haskell pre-processor".

http://www.haskell.org/ghc/docs/6.6/html/users_guide/options-phases.html#pre-processor

Find attached my convert.sh script.
Christian

Andreas Marth schrieb:
> How was that with Haskell and Unicode???
> 
> While up to ghc-6.4.2 the following function worked it now doesn't compile:
> 
> isSpezGermanChar :: Char -> Bool
> isSpezGermanChar 'ä' = True
> isSpezGermanChar 'ö' = True
> isSpezGermanChar 'ü' = True
> isSpezGermanChar 'Ä' = True
> isSpezGermanChar 'Ö' = True
> isSpezGermanChar 'Ü' = True
> isSpezGermanChar 'ß' = True
> isSpezGermanChar  _  = False
> 
> (For those of you who will only read garbage it are/were some letters from
> the german alphabet.)
> 
> I hoped we move forward to easier internationalization.
> 
> Any ideas what to do now? (I would like to keep the code readable and not
> use '\220' and so on.
> 
> Thanks,
> Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: convert.sh
Type: application/x-shellscript
Size: 81 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/haskell/attachments/20061017/aebf6d2f/convert-0001.bin


More information about the Haskell mailing list