change Reader and Writer

PrintWriter pw = new PrintWriter(    new BufferedWriter(new
OutputStreamWriter(new FileOutputStream(outFile, tOrF), "UTF-8")));

new PrintWriter(new BufferedWriter(new FileWriter(
new PrintWriter(new BufferedWriter(new OutputStreamWriter(new
FileOutputStream(

false)));
tOrF), "UTF-8")));

new FileReader(trainFile));
new InputStreamReader(new FileInputStream(inFileName), "UTF-8"));