Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Hebrew RTL String With Numeric Value Flipped

I would like to display a String with my app name and it's current version. The app name is in hebrew, for some when I combine hebrew text with numeric value, the numeric value is flipped.

versionTextView.setText("אפליקציה גרסה "+this.getResources().getString(R.string.app_version));

for example: app version is 1.0, being display as 0.1 on emulator.

like image 218
jkigel Avatar asked Aug 05 '12 08:08

jkigel


1 Answers

Sounds like a bug in the Android bidi algorithm. Try adding left-to-right marks around the numbers:

versionTextView.setText("אפליקציה גרסה "
    + "\u200e"
    + this.getResources().getString(R.string.app_version)
    + "\u200e"
);

(If this works, you may be able to eliminate the second one.)

like image 115
Ted Hopp Avatar answered Sep 24 '22 02:09

Ted Hopp