Unicode strings in .Net with Hebrew letters and numbers

Viewed 7053

There is a strange behavior when trying to create string which contains a Hebrew letter and a digit. The digit will always be displayed left to the letter. For example:

string A = "\u05E9"; //A Hebrew letter
string B = "23";
string AB = A + B;
textBlock1.Text = AB;
//Ouput bug - B is left to A.

This bug only happens when using both a Hebrew letter and digits. When omitting one of those from the equation the bug won't happen:

string A = "\u20AA"; //Some random Unicode.
string B = "23";
string AB = A + B;
textBlock1.Text = AB;
//Output OK.

string A = "\u05E9"; //A Hebrew letter.
string B = "HELLO";
string AB = A + B;
textBlock1.Text = AB;
//Output OK.

I tried playing with FlowDirection property but it didn't help.

A workaround to get the text displayed properly in the first code exmaple would be welcomed.

4 Answers
Related