I bet that in the Flash MX development team there is no one who speaks Hebrew. How do I come to this conclusion? Well, I'm currently trying create a Hebrew version of a site and you know what - I'm going through hell. You get the impression that no one at Macromedia has tried this before.
For those who don't know what's the big deal a short explanation: Hebrew as well as Arabic are written from right to left opposed to english or european languages that are written from left to right. This poses a challenge to computers because you need to use a special bidirectional algorithm in order to display these texts correctly. It get especially tricky if you mix leftright and rightleft phrases within a text.
Here is a demo (some nonsense text) to give you a little impression how mindboggling this is. Click inside the textfield and move the cursor around:
But now we add another level of difficulty to this scenario: Flash. At least since MX we can use Unicode, but that's about it. Everything beyond that like right-to-left textflow you'll have to do manually. And that's where the pain starts because something is really strange here. I've created a little demo to show you a surprising effect:
First issue: text 1 and 2 have exactly the same source. The only difference is that text 1 is non-embedded whereas text 2 is. On my browser 1 is a reverse version of 2. On yours too? I don't know if this is a browser or OS problem, so if on anyone's system the two texts are equal please leave a comment. If it behaves the same on all systems it's at least something one can rely on.
Second issue: select text 1. Uaaaaahhh. Do the letters on your browser also get jumbled? This is not an Actionscript trick I play here. This is something that either comes from the player itself or from the system. I don't know yet. BTW - select text 2 - everything is fine.
Currently that's as far as I have gotten. It looks like you will have to always embed the characters if you are using Hebrew or Arabic. In order to handle the general right-to-left problem I will probably go for a server-side solution. But of course an Actionscript implementation of the BiDi algorithm would be great. Anyone's interested?
So is it just my system if everybody sees it correct? Aaaarrgg! Here is a screenshot how the flash looks on my screen:
Posted at May 28, 2003 06:30 PM | Further reading
and this is a selected view: