StringBuffer buffer = new StringBuffer();
try {
InputStreamReader reader = new InputStreamReader(
new FileInputStream("E:\\AIS\\en-En\\NewFile.native_rubric"), "UTF8");
for (int c = reader.read(); c != -1; c = reader.read()) {
buffer.append((char) c);
}
} catch (Exception e) {
e.printStackTrace();
}
try {
String f = "E:\\AIS\\fr-FR\\NewFile.native_rubric";
Writer out = new BufferedWriter(new OutputStreamWriter(
new FileOutputStream(f), "Shift-JIS"));
out.write(buffer.toString());
}catch() {}
i am trying to read file as UTF8 and writing in another file as Shift-JIS but it's not working
please suggest solution