Fixed excel cannot read UTF-8 character from csv file

pleng
Nov 1, 2021

I have problem when open file csv in excel cannot read character with UTF-8

I found how to fix ,It just save character prefix befrore content with

239 EF
187 BB
191 BF

just write code like this

    String line = "เทส, hello, เทส";
OutputStream os = new FileOutputStream("c:/temp/j.csv");
os.write(239);
os.write(187);
os.write(191);

reference

https://stackoverflow.com/questions/4192186/setting-a-utf-8-in-java-and-csv-file/4192803#4192803

--

--