Code ASCII java
Résolu/Fermé
nour_master
choubaka
- Messages postés
- 10
- Date d'inscription
- mardi 11 novembre 2008
- Statut
- Membre
- Dernière intervention
- 17 décembre 2008
choubaka
- Messages postés
- 39006
- Date d'inscription
- jeudi 4 avril 2002
- Statut
- Modérateur
- Dernière intervention
- 28 mai 2022
2 réponses
choubaka
12 nov. 2008 à 15:46
- Messages postés
- 39006
- Date d'inscription
- jeudi 4 avril 2002
- Statut
- Modérateur
- Dernière intervention
- 28 mai 2022
12 nov. 2008 à 15:46
Salut
il y a la méthode ci dessous de l'objet String
getBytes()
Convert this String into bytes according to the platform's default character encoding, storing the result into a new byte array.
il y a la méthode ci dessous de l'objet String
getBytes()
Convert this String into bytes according to the platform's default character encoding, storing the result into a new byte array.
choubaka
13 nov. 2008 à 23:08
- Messages postés
- 39006
- Date d'inscription
- jeudi 4 avril 2002
- Statut
- Modérateur
- Dernière intervention
- 28 mai 2022
13 nov. 2008 à 23:08
salut
suivant ce lien
http://java.sun.com/j2se/1.3/docs/api/java/lang/package-summary.html#charenc
si tu regardes bien, il y a une remarque concernant la machine virtuelle java
"Every instance of the Java virtual machine has a default character encoding. The default encoding is determined during virtual-machine startup and typically depends upon the locale and encoding being used by the underlying operating system."
en fait, tu dois vérifier ceci
par défaut, c'est le US-ASCII qui est implémenté, tu dois modifier les paramètre de ta machine virtuelle et mettre l'UTF-8 si tu veux du 8 bits
suivant ce lien
http://java.sun.com/j2se/1.3/docs/api/java/lang/package-summary.html#charenc
si tu regardes bien, il y a une remarque concernant la machine virtuelle java
"Every instance of the Java virtual machine has a default character encoding. The default encoding is determined during virtual-machine startup and typically depends upon the locale and encoding being used by the underlying operating system."
en fait, tu dois vérifier ceci
Every implementation of the Java platform is required to support the following character encodings. Consult the release documentation for your implementation to see if any other encodings are supported. US-ASCII Seven-bit ASCII, a.k.a. ISO646-US, a.k.a. the Basic Latin block of the Unicode character set ISO-8859-1 ISO Latin Alphabet No. 1, a.k.a. ISO-LATIN-1 UTF-8 Eight-bit Unicode Transformation Format UTF-16BE Sixteen-bit Unicode Transformation Format, big-endian byte order UTF-16LE Sixteen-bit Unicode Transformation Format, little-endian byte order UTF-16 Sixteen-bit Unicode Transformation Format, byte order specified by a mandatory initial byte-order mark (either order accepted on input, big-endian used on output)
par défaut, c'est le US-ASCII qui est implémenté, tu dois modifier les paramètre de ta machine virtuelle et mettre l'UTF-8 si tu veux du 8 bits
13 nov. 2008 à 13:26
merci encord