There are a set of text based files which have to be modified. The files are in different encoding formats and the encoding formats should be maintained. Could someone please help me in finding the encoding format used in the file?
Thanks for the reply.
I have a Japanese windows resource file (.rc) which is in ANSI format. I have tried with the juniversalchardet library. The output from juniversalchardet for the file is Shift-JIS. I used the following code snippet to copy the file.
When copied, the characters are not the same as the original. I have tried it with the 'Shift-JIS' character set and the output is not same as the original.
FileInputStream fr = new FileInputStream(orig);
InputStreamReader is = new InputStreamReader(fr);
BufferedReader br = new BufferedReader(is);
FileOutputStream fw = new FileOutputStream(targ);
OutputStreamWriter os = new OutputStreamWriter(fw, "ASCII");
BufferedWriter bw = new BufferedWriter(os);