I am using the following below java code to convert the numerics to arabic
String str = "1234-5678-9101";
char[] chars = {'٠','١','٢','٣','٤','٥','٦','٧','٨','٩'};
StringBuilder builder = new StringBuilder();
for (int i = 0; i < str.length(); ++i) {
if (Character.isDigit(str.charAt(i))) {
builder.append(Chars[(int)(str.charAt(i))-48]);
} else {
builder.append(str.charAt(i));
}
}
the expected output is ٩١٠١-٥٦٧٨-١٢٣٤ but the result is ١٢٣٤-٥٦٧٨-٩١٠١ (reverse direction)