Read and Write Text in ANSI format

To read a text file with a specific encoding you can use a FileInputStream in conjunction with a InputStreamReader. The right Java encoding for Windows ANSI is Cp1252. reader = new BufferedReader(new InputStreamReader(new FileInputStream(csvFile), “Cp1252”)); To write a text file with a specific character encoding you can use a FileOutputStream together with a OutputStreamWriter. writer … Read more