[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [FYI] Python 2.0 problems!!!
- To: developer at arabeyes dot org
- Subject: Re: [FYI] Python 2.0 problems!!!
- From: Walid Shaari <shaari at arabeyes dot org>
- Date: 01 Feb 2003 22:40:15 +0000
- Organization: www.arabeyes.org
On Sat, 2003-02-01 at 21:19, Mohammed Elzubeir wrote:
> I am not sure what you are trying to do (and I guess you're not sure what
> your question is ;) -- but to clarify some things:
mmh! I am trying to see if I can use python as my main dev/RAD tool
>
> Generally you don't print Unicode strings, instead you encode them (hopefully
> in UTF-8). For instance, using Unicode strings is useful if you want
> to do certain analysis (I find it useful in some testing with
> Duali) so your libraries don't necessarily have to care about the specific
> encoding.
> e.g.
> str = u'\u0631\u0632\u0633
missing single Quote ;-)
> print str.encode('utf-8')
> Now you are outputting in UTF-8 encoding. Likewise, you can convert a
> given encoding to unicode.
>
> str2 = str.encode('utf-8')
> str3 = unicode(str, 'utf-8')
mmh! I guess you mean str3=unicode(str2,'utf-8')
>
> Now we have str3 back to the same unicode as the original 'str'. Pretty
> nifty ;)
can you clear the above confusions? and how one would make use of python
in Arabic Enabled apps/scripts
Walid