[英]Hindi font is visible when I am running JFrame program from Netbeans but not visible when running .jar file
I am using Hindi fonts in my project and when I am running it on Netbeans it works fine, but when I am run its .jar file it does not load Hindi font, but shows some garbage things. 我在项目中使用印地语字体,当我在Netbeans上运行它时,它工作正常,但是当我运行其.jar文件时,它不会加载印地语字体,但会显示一些垃圾内容。 I am using UTF-8 encoding in Netbeans, and Arial Unicode MS font.
我在Netbeans中使用UTF-8编码,并使用Arial Unicode MS字体。
When running from Netbeans: 从Netbeans运行时:
When running .jar file: 运行.jar文件时:
There are no issues in English. 英文没有问题。 Thanks in advance.
提前致谢。
I have solved my problem, it was happening because I was using UTF-8 in NetBeans, but .jar file was using some other encoding. 我已经解决了我的问题,这是因为我在NetBeans中使用UTF-8,但是.jar文件正在使用其他编码。 So when reading the file I gave CharSet UTF-8.
因此,在读取文件时,我给了CharSet UTF-8。
List<String> s= Files.readAllLines(Paths.get(langPath + "\\" + ExcerciseList.getSelectedValue() + ".txt"),Charset.forName("UTF-8"));
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.