[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Need BIDI help



Salamo Alikom,
I'm localizing reports written in C. The code creates a "line" by inserting tokens into a string (let us call it Buffer). When several Arabic words come next to each other, this part of the line is reversed. I tried to separate each word by an english letter "e", and it worked. But "e" will appear in the report which is unacceptable.

I traced the problem and found the following:
Let us declare "Buffer" as a string, Initialize it as follows:
       Buffer="eaaaaebb"
"Memory"----15432687

Where "e" means English character(Left to right), "a" means Arabic word (Right to left), and "b" means another arabic word. I found that the place of each character in the array is as shown in the "Memory" line.

So it deals with the arabic charaters from right to left.

If I removed the second "e", the string is totally reversed(But "e" will remain unchanged)
                                  remove middle "e"
       Buffer="eaaaaebb" --------------------->   Buffer="ebbaaaa"
"Memory"----15432687                     "Memory"----1765432

I need to have the "bb" to be in the same place before removing "e" i.e. to the right of "aaaa".

Is there any "Left to right" character that can be put instead of "e", but I need that this character doesn't have any graphical presentation (I need it to be something like "space"). I tried "spcae" and most of the charaters in the ASCII table but they don't affect the orientation.
 
I was told (By brother Ahmad Khalifa )to add the the Left to Right Override(LRO), its Code is \u202D. But each time I add it the C compiler says that \u is an unknown sequence. Can any one tell me how to insert a unicode character in a string or by wprintf()
 
I also was told about the miniBIDI.c, I found the function DOBIDI(), But I couldn't send to it the LRO, Can u send me a sample code as example?
 
Thank you for your help
Khalid