Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am working on a project that is based on Urdu language in Ubuntu platform. I'm using Python language and have almost achieved my task.

The problem is that, the Urdu text is rendered in reverse order.

For example, consider the word کام (which means work) consisting of the three letters: ک ,
ا , and م

The output is rendered in reverse order as ماک consisting of the three letters: م,
ا, and ک

When copying this text to Open Office or opening the generated XML file in Firefox, the generated result is absolutely desired.

I Am using Python 2.6 IDLE, its working perfect with Windows platform, which clearly shows its not the problem of IDLE. Am working on TKINTER GUI library.

How can this problem be solved?

share|improve this question
1  
Surely this depnds on what kind of program you're working on - Web application, console application, GUI application (which toolkit?). –  loevborg Jan 11 '11 at 14:31

2 Answers 2

Tkinter is a wrapper around the Tk widget set. According to http://wiki.tcl.tk/3158, Tk does not support bidirectional text rendering, which would explain why the Urdu characters were displayed left to right.

Unless you've got a particular attachment to Tk, I'd suggest using a more modern graphics toolkit like GTK or Qt. If you must use Tk, you'll probably be stuck needing to manually reorder characters to presentation order.

share|improve this answer

As a simple solution try reversing the string and then display it. Also look at localization options in Python. I dont know if Python supports Right-to-Left languages. You would get better answer to this question if you ask it at StackOverflow

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.