我正在使用此代码将String写入文本文件。字符串是英文和阿拉伯字母的组合。当我在eclipse中运行代码时它工作正常,但是当我将代码提取到Runnable JAR文件并运行它时,所有阿拉伯字母都被问号替换。
Writer writer = new OutputStreamWriter(new FileOutputStream(filename), "UTF-8");
bw = new BufferedWriter(writer);
bw.write("<meta http-equiv='Content-Type' content='text/html;charset=UTF-8'>");