I would always look first for a library to do anything complex. (Perhaps I am just lazy ;-)
I don't understand Arabic either, but I investigated enough to understand at a basic level how characters change depending on their relative positions. Then I went out to find the best library to do the conversion for me.
The reason I went with fribidi (despite being LGPL), is because Pango (on Linux) uses it for it's right-to-left mapping. And since that is known to work well, it seemed a good choice.
Of course, to use these RTL Strings properly, you will need to right-align them correctly, but that's not a big issue (and something you can cache if required).
:o)
I don't understand Arabic either, but I investigated enough to understand at a basic level how characters change depending on their relative positions. Then I went out to find the best library to do the conversion for me.
The reason I went with fribidi (despite being LGPL), is because Pango (on Linux) uses it for it's right-to-left mapping. And since that is known to work well, it seemed a good choice.
Of course, to use these RTL Strings properly, you will need to right-align them correctly, but that's not a big issue (and something you can cache if required).
:o)