Affichage de la valeur unicode d'un caractère
bonjour,
voilà mon code
.....
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| String string = new String ("بج") ; // en arabe.
String stringUTF = new String ( string.getBytes(), "UTF-8" );
DevoyellationArabe.getStrDevArabe(stringUTF);
et la fonction getStrDevArabe est la suivante:
public static String getStrDevArabe (String str){
if (str.charAt(0) == 'ب') {
System.out.println(" c'est correct B +++++++++++++++++++");
} else {
System.out.println(" c'est pas correct -----------------------");
}
System.out.print(str.charAt(0));
return null;
} |
et il m'affiche
Code:
1 2
| c'est correct B +++++++++++++++++++
? |
à la place de ? je veux avoir l'unicode du caractère en question c'est à dire : \u0628