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!

Need Help in parsing Japanese SHIFT JIS Characters in Java

706710Jun 20 2009 — edited Jun 26 2009
Hi All

I'm facing a problem while *"Parsing Japanese SHIFT JIS Characters in Java"*

The flow is

im uploading a CSV file with "Japanese SHIFT JIS characters" with encoding type --> UTF-8

Then we have The below logic where we use a bufferedReader as shown below

BufferedReader  bufferedReader = null;
bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream("C:/Documents and Settings/Administrator/Desktop/JapaneseCharactersSHIFTJIS/APH_HT_18June.txt"),"UTF-8")); 
It parses and then we have a encodeRow method where we are doing as below
encodeRow(){
         String newValue = new String(fieldValue.getBytes(en),"ISO88591") //we are taking a charset related to ISO88591       
         row.set(fieldName,newValue);  //here newValue is coming as Junk Characters  
}
hence we see that newValue is also having Junk characters

Please help and advice
( I need a solution such that i upload a file(Japanese/chinese/korean) in UTF 8 format and it should not show junk characters....i want to achieve this through code....
Please advice Java Experts

I need a solution such that

1> First i upload a CSV/UDF File.txt (Japanese/chinese/korean) in UTF-8(encoding type) format
2> The the encodeRow Method is called such that it sets the respective encoding type for japanese/chinese/korean/any other language(how do i achieve this ??)
3> row.set(fieldName,newValue); //we have this line where newValue should show valid Japanese Shift JIS/Korean/Chinese..

i want to achieve this through code

Help provided will be highly appreciated.

Im stuck up with this for a long time....neeed help Sun Java experts.

I will be highly obliged if you could help me

Thanks
Deepak
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 24 2009
Added on Jun 20 2009
9 comments
4,486 views