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
On 2006-10-17 at 16:31+0200 "Andreas Marth" wrote:
How was that with Haskell and Unicode???
I think this probably belongs on ghc-users rather than Haskell. Anyhow, there aren't any ASCII characters higher than 127.
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.
What ought to work is to use Unicode for input. If the files you want to process with your programme are encoded in ISO-8859-1, you may have to do something yourself to handle that. If my mailer is behaving itself, this message will have been translated into Unicode, so the table above might work. Jón -- Jón Fairbairn Jon.Fairbairn at cl.cam.ac.uk
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... 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
participants (3)
-
Andreas Marth -
Christian Maeder -
Jon Fairbairn