Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

UTF8 to Shift_JIS conversion problem

807603Jan 14 2008 — edited Jan 15 2008
		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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 12 2008
Added on Jan 14 2008
44 comments
2,684 views