toEnum with international chars

Eray Ozkural erayo@cs.bilkent.edu.tr
Tue, 28 May 2002 03:57:41 +0300


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