[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[FYI] Python 2.0 problems!!!



Dear Arabeyes,

I have installed mlterm 2.6.3, and was trying to print Arabic Strings
using python Interpreter for example just a simple letter as in:

	print u'\u0631\u0632\u0633'

It didn't seem to work at first as it was giving me this error :

	UnicodeError: ASCII encoding error: ordinal not in range(128)

Through trail and Errors, and some googling I managed to solve this with
the following code :

	import sys
	reload (sys)
	sys.setdefaultencoding('utf-8')
	print u'\u0631\u0632\u0633'

it prints on the right hand side correctly as I wanted!

So where is my Question?

I don't really have a question yet, but noting the above could be added
to either the Arabic howto, or even by archiving it some-one else can
benefit.

Other than that, please advise me if there is a better Arabeyesiation
solution for a pythonist ;-)


Wa Salam
-- 
      _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
     / Walid Shaari	      /  "One code base for the world /	
    / Arabeyes Project       /  English is just another      /  
   /__another Unix Solution /  language"mozilla.org       __/ 
  /__/_____________________/_____________________________/_/