• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Unicode CSV file.

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 781
Netbeans IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try utf-16 rather than utf-8.
 
reply
    Bookmark Topic Watch Topic
  • New Topic