I am trying to create a CSV file with Arabic characters in it, but the file shows some junk characters instead of Arabic.
The first code I tried:
PrintWriter pw = new PrintWriter("C:\\WriteTest.CSV","UTF-8");
pw.println("a csv file and now a new line is going to come");
a csv file and now a new line is going to come
My second attempt:
FileOutputStream fos = new FileOutputStream("C:\\WriteTest1.csv");
String in = new String("خثتيهث", "UTF8");
Please suggest how I can create a CSV with Arabic characters in it. My code works well when I change the file from CSV to txt.