Re: encoding - arabic(IBM 864) to UNICODE

2007-03-18 Thread Mohammad Tayseer
text_864 = "\xd1" unicode_string = unicode(text_864, encoding="cp864") # cp864 = IBM 864 The above code is working with Python 2.4. Unfortunately, it doesn't support IBM 420 & Nafitha. The mapping between IBM 864 and unicode is in Lib/encodings & the file is very simple. You can add your own ea

Re: encoding - arabic(IBM 864) to UNICODE

2007-03-18 Thread Peter Otten
Madhu Alagu wrote: > How to convert IBM 864,IBM 420 & Nafitha(Arabic) to UNICODE. You can treat them like every other encoding: >>> s = '\xe1\xec\xf0\xe8\xe1' # * >>> print s.decode("cp864") # convert from cp864 to unicode ﻓﻌﹽﻭﻓ >>> s.decode("cp864").encode("utf8") # convert from cp864 to utf-8

Re: encoding - arabic(IBM 864) to UNICODE

2007-03-18 Thread Jorge Godoy
"Madhu Alagu" <[EMAIL PROTECTED]> writes: > Hello, > > How to convert IBM 864,IBM 420 & Nafitha(Arabic) to UNICODE. Your OS should have some tools for that. On Linux I use 'iconv' to convert from several encodings to several other encodings. Another option is checking if Python has those encod

encoding - arabic(IBM 864) to UNICODE

2007-03-18 Thread Madhu Alagu
Hello, How to convert IBM 864,IBM 420 & Nafitha(Arabic) to UNICODE. Thanks Madhu Alagu -- http://mail.python.org/mailman/listinfo/python-list