我想将缅甸文本写入.csv
文件。将缅甸文文本写入.csv
文件后,我打开该文件,MS Office
但它不显示缅甸文文本。我的电脑中设置了缅甸字体。下面是我的代码:
OutputStreamWriter char_output = new OutputStreamWriter(new
FileOutputStream(CSV.getAbsolutePath().toString()),
Charset.forName("UTF-8").newEncoder());
char_output.write(message + str);
char_output.write("\n");
for (int i = 0; i < pList.size(); i++)
{
StringBuilder sb = new StringBuilder();
sb.append(pList.get(i).getOrderNumber()).append(",").append(pList.get(i).getProductName()).append(",");
sb.append(pList.get(i).getProductDiscription()).append(",").append(pList.get(i).getWeightKg()).append(",");
sb.append(pList.get(i).getWeightViss()).append(",").append(pList.get(i).getQty()).append(",");
sb.append(pList.get(i).getDate()).append("\n");
char_output.write(sb.toString())`FileOutputStream(CSV.getAbsolutePath().toString() ),
}
char_output.close();