Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unicode CSV file.

 
Shriram Gopalakrishnan
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am reading a Unicode CSV file which is getting read using CSVReader reader=new CSVReader(new InputStreamReader(new FileInputStream(in),"UTF-8"),'\t');
now when I print the file contents


The output is in UTF-8 for example : C r e a t e
Now when I try to compare this with normal String str=new String("CREATE".getBytes(Charset.forName("UTF-8")),"UTF-8"); its not same or equal.

So the question is how to convert or represent a String in UTF-8 format ? str.getBytes(charset) is not doing the job for me as mentioned above.
 
James Sabre
Ranch Hand
Posts: 781
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try utf-16 rather than utf-8.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic