Ecriture et lecture des mots arabes dans les fichiers Java

ahf_msig Messages postés 3 Date d'inscription lundi 16 avril 2007 Statut Membre Dernière intervention 9 avril 2010 - 30 mars 2010 à 17:51
cs_rt15 Messages postés 3874 Date d'inscription mardi 8 mars 2005 Statut Modérateur Dernière intervention 7 novembre 2014 - 3 avril 2010 à 11:34
Bonjour la liste,
j'ai un probléme en face, bon je veux enregistrer mes données arabe dans un fichier texte puis les récuperer via une interface Swing, mais je trouve des caractéres non lus comme "?????" et ca malgré l'utilisation de l'encodage UTF-8.
merci

3 réponses

gaalouldeksour Messages postés 3 Date d'inscription dimanche 1 mars 2009 Statut Membre Dernière intervention 31 mars 2010
30 mars 2010 à 18:57
Bonjour,
can you put your code in this page ? i will try with you
0
ahf_msig Messages postés 3 Date d'inscription lundi 16 avril 2007 Statut Membre Dernière intervention 9 avril 2010
30 mars 2010 à 19:05
Bonjour, voila le code en question merci bien!!!

import java.io.*;


import java.io.Writer;

public class fi {


public static void main(String[] args) {
// TODO Auto-generated method stub

String c1,c2,c3;
String table[]= new String[10];
table[0] = "?????";
table[1] = "العربية ";
table[2] = "ربية ";
/*table[3] = "???? ";
table[4] = "???????";
table[5] = "????? ";
table[6] = "????? ";
table[7] = "??????? ";
table[8] = "???? ";
table[9] = "???? ";

String message1=table[0]+"&"+table[1]+"&"+table[2]+"&"+table[3]+"&"+table[4]+"&"+table[5]+"&"+table[6]+"&"+table[7]+"&"+table[8]+"&"+table[9]+"&";
*/
System.out.println("التقى ");

try{

FileOutputStream fos = new FileOutputStream("f.txt" );
Writer out = new OutputStreamWriter(fos, "UTF-8" );
out.write("التقى");

}
catch(Exception e){
e.printStackTrace();
}


}



}
0
cs_rt15 Messages postés 3874 Date d'inscription mardi 8 mars 2005 Statut Modérateur Dernière intervention 7 novembre 2014 13
3 avril 2010 à 11:34
Bonjour,

Pour une question java, merci de poster sur javafr dans un thème java.

[ Déplacé sur javafr ]
0
Rejoignez-nous