dcsimg
I/O encoding
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Marek_Strop
Posted On:   Thursday, April 1, 2004 10:26 PM

Please, could anybody help me with charset encoding problem? I am trying to read a text file in Cp1250. If there were standard ASCII characters ( < 127) I have no problem. If there was at least 1 character > 127 (national character) the reading fails with MalformedInputException. I read the file this way:


File f;


...


FileReader in = new FileReader(f);
BufferedReader dis = new BufferedReader(in);


String line;


line = dis.readLine();

Re: I/O encoding

Posted By:   Stephen_Ostermiller  
Posted On:   Friday, April 2, 2004 05:55 PM


BufferedReader in = new BufferedReader(
new InputStreamReader(
new FileInputStream(f),
"Cp1250"
)
);
String line = in.readLine();
About | Sitemap | Contact