I have a code that reads a string from a list of CChar's
shortName = map (toEnum.fromIntegral) shortname
When I have a turkish character like Ý the interpreter will: StockList> a <- readStockInfo h [66,105,108,105,-2,105,109,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32] StockList> a *** Exception: Prelude.chr: bad argument The problem is the 66 in the beginning of the list. I'm not giving the entire code, it's not needed... What should I be using to work with such strings? Thanks, -- Eray Ozkural (exa) <erayo@cs.bilkent.edu.tr> Comp. Sci. Dept., Bilkent University, Ankara www: http://www.cs.bilkent.edu.tr/~erayo Malfunction: http://mp3.com/ariza GPG public key fingerprint: 360C 852F 88B0 A745 F31B EA0F 7C07 AE16 874D 539C
Can you explain your problem more clearly? I'm struggling to understand what was wrong given only a fragment of the program, none of the input and only an indication of where the problem lies in the output but not what that problem is. [This probably won't affect the answer though - which will probably be an admission that most Haskell compilers don't support international characters properly.] -- Alastair Reid reid@cs.utah.edu http://www.cs.utah.edu/~reid/
On Tuesday 28 May 2002 13:32, Alastair Reid wrote:
Can you explain your problem more clearly? I'm struggling to understand what was wrong given only a fragment of the program, none of the input and only an indication of where the problem lies in the output but not what that problem is.
[This probably won't affect the answer though - which will probably be an admission that most Haskell compilers don't support international characters properly.]
Oh, my bad, I think I gave a wrong list there. 66 is of course 'B', I was a little sleepless at the time of writing. Now having enjoyed a few hours of sleep I can express more eloquently :) It seems to be the fourth character that is the problem, but then again that's my mistake. Thank you. Still it attracts my attention that I cannot type þ in ghci while I can type it in bash. I think I can't type any of those international chars in ghc. Maybe some bug fix is in order. Regards, -- Eray Ozkural (exa) <erayo@cs.bilkent.edu.tr> Comp. Sci. Dept., Bilkent University, Ankara www: http://www.cs.bilkent.edu.tr/~erayo Malfunction: http://mp3.com/ariza GPG public key fingerprint: 360C 852F 88B0 A745 F31B EA0F 7C07 AE16 874D 539C
participants (2)
-
Alastair Reid -
Eray Ozkural