print arabic characters
Ahmad
eng_ak at link.net
Mon Dec 22 14:13:33 EST 2003
Sorry for not being very verbose
I am on Linux Redhat9. Terminal used is Konsole. I am not really sure
if the terminal should be the one re-arranging the chars?! The konsole
people say it should be the application programmer to arrange the bidi
chars correctly!
Also, I hope that my application will be cross-platform, so if there
is a way that will work with windows please tell me...
Do I need python2.3? I think the one pre-packaged is 2.2
Also, how do I print "(U+U200F)"?
Thnx a lot
"Martin v. Loewis" <martin at v.loewis.de> wrote in message news:<bs6mpb$g9d$03$1 at news.t-online.com>...
> Ahmad wrote:
>
> > I am a python newbie, I want to print on the console UTF-8 arabic
> > characters. They print OK with
> > print text.encode("UTF-8")
>
> Are you talking about console mode (i.e. the cmd.exe window)? Or are
> you perhaps talking about IDLE?
>
> In Python 2.3, they should also print ok when you print a Unicode object
> proper; sys.stdout.encoding should indicate what encoding the terminal
> uses.
>
> > BUT, the characters are printed LTR, not RTL (right to left). How can
> > I change the printing direction??
>
> Assuming it is IDLE: This is a bug in Tk, then - I don't know whether
> Tk supports RTL.
>
> Assuming it is the terminal: Does the terminal support RTL in the first
> place? Python does nothing else but write the characters in logical
> order to the terminal stream; it would be the terminal's job to put
> them in the right display order. Perhaps printing RIGHT-TO-LEFT MARK
> (U+U200F) helps?
>
> Regards,
> Martin
More information about the Python-list
mailing list