import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
public class MainClass {
public static void main(String[] argv) {
try {
FileOutputStream fos = new FileOutputStream("sometext.txt");
OutputStreamWriter osw = new OutputStreamWriter(fos, "ISO8859-8");
// various write operations go here
osw.close();
} catch (UnsupportedEncodingException ee) {
System.out.println("Encoding ISO8859-8 not supported");
} catch (IOException ie) {
System.out.println(ie);
}
}
}
|