如何在命令行上设置JVM字符集? [英] How to set the JVM charset on the command line?

查看:120
本文介绍了如何在命令行上设置JVM字符集?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

设置JVM的字符集的命令是什么?



(此外,查看当前JVM的字符集的命令是什么,所以我知道如何重置它

解决方案

java字符串内部始终为utf-16( javadoc链接< a>),但您可以使用 -Dfile.encoding = UTF-8 以便于使用默认字符集读取文件。



只要确保java可以访问该文件集,当您设置它或它不会启动。


What's the command to set the JVM's character set?

(Also, what's the command to view the current JVM's character set, so I know how to reset it back to default after I'm done)

Thanks,

解决方案

java strings are always utf-16 internally (javadoc link), but you can use -Dfile.encoding=UTF-8 to facilitate reading files with a default charset.

Just ensure java has access to that fileset when you set it or it won't start.

这篇关于如何在命令行上设置JVM字符集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆