Arvind
Arvind

Reputation: 6474

how to read/write text of specified charset in java

I have a scenario where I have to read/write data from/into csv files. I understand that a csv can be read/written into just like a text file.

What I want to know is, how do I handle the charset? For eg if a piece of text has to be read from a chinese language csv file, then how do I read it?

Upvotes: 0

Views: 184

Answers (1)

Garbage
Garbage

Reputation: 1520

Try following:

BufferedReader br = new BufferedReader(new InputStreamReader(myFile.getInputStream(), "ISO-8859-15")); // Give your desired charset here

Upvotes: 1

Related Questions