0
我想將緬甸文本寫入.csv
文件。在將緬甸文本寫入.csv
文件後,我用MS Office
打開該文件,但它不顯示緬甸文本。 緬甸字體在我的電腦中設置。 以下是我的代碼:如何將緬甸文本寫入CSV文件android
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();