سلام
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package javaapplication1;
import com.sun.org.apache.xerces.internal.impl.io.UTF8Rea der;
import com.sun.xml.internal.stream.writers.UTF8OutputStre amWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.util.Scanner;
import javax.swing.JOptionPane;
/**
*
* @author Ahmad Dehnavi
*/
public class JavaApplication1 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
try {
UTF8OutputStreamWriter u=new UTF8OutputStreamWriter(new FileOutputStream("c:\\test.txt"));
u.write("سلام");
u.close();
UTF8Reader r=new UTF8Reader(new FileInputStream("c:\\test.txt"));
Scanner sc=new Scanner(r);
JOptionPane.showMessageDialog(null, sc.nextLine());
} catch (Exception ex) { }
}
}