Does EmWi support Arabic strings?
Description
This article explains possibilities for Arabic string handling within EmWi.
Solution
Currently EmWi does not support any special features for Arabic string support. The reason for this fact is that Arabic string handling requires a complex shaping engine to deal with the specialties of the Arabic language. This is currently out of scope due to the enormous development efforts. Nevertheless this article shows up the issues to be solved for Arabic strings and how it could realized with the available techniques in EmWi:
- Right-to-left and left-to-right handling:
EmWi expects the character sequence always from left-to-right. To achieve right-to-left strings, you have the possibility to enter the characters directly in EmWi or in our Excel sheet template ‘Strings.xls ’as they should appear in left-to-right reading. Another possibility would be to extend the Visual Basic macro of our Excel sheet template to change the character order e.g.:
' change order for arabic strings -> first char 0x600-0x6FF
textSub = Right(text, textPos)
charVal = AscW(textSub)
If (charVal > 1535 And charVal < 1792) Then
arabText = ""
For I = 0 To (textLength - 1)
arabText = arabText & Mid(text, textLength - I, 1)
Next
text = Left(arabText, textLength)
End If
- Initial, medial, final and separated characters:
Arabic strings do not indicate upper-case or lower-case letters. The shaping engine decides for a character, whether the initial, medial, final or separated glyph will be rendered, according to its position within a string. To realize the correct Arabic string, you need a font that covers all single Arabic characters in its real appearance as a single character code within your font. With such a font you can edit the characters manually with respect to the correct shape at a certain position within a string.
- Accented characters:
EmWi can’t merge characters with accents. Therefore all accented characters must be present within your font as single Arabic character in its real appearance as a single character code. Moreover each accented character must as well be present in it’s initial medial, final and separated shape.
Example:
The following example shows the implementation of Arabic strings as mentioned above:
const string Monday = "\Ufee6\Ufef4\Ufee8\Ufe9b\Ufefa\U0627";
const string Tuesday = "\U0621\Ufe8e\Ufe9b\Ufefc\Ufe9c\Ufedf\U0627";
const string Wednesday = "\U0621\Ufe8e\Ufecc\Ufe91\Ufead\Ufef7\U0627";
const string Thursday = "\Ufee6\Ufeb4\Ufef4\Ufee4\Ufccb\U0627";
const string Friday = "\Ufe94\Ufecc\Ufee4\Ufcc9\U0627";
const string Saturday = "\Ufe96\Ufe92\Ufeb4\Ufedf\U0627";
const string Sunday = "\Ufeaa\Ufea3\Ufefb\U0627";
If you include the required font range for the Arabic characters in your font the result in EmWi shows the weekdays in Arabic language with right-to-left orientation.

Note: The shown content is just an example which is not verified from a native Arabic speaker. We apologize if there are some typos in the above example.
See also
HowTo document [HT-007-Excel_String_Table_Import.pdf]
Keywords
String generation, Excel, macro, Arabic, accented, separated, initial, medial, final, right-to-left, left-to-right
Last update on 2010-08-19 by Mario Stefanutti.