Java sun.jnu.encoding 究竟是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1066845/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What exactly is sun.jnu.encoding?
提问by
What is the purpose of the system property sun.jnu.encoding
? Various fragments on the web set or report it, but I can't find a definition.
系统属性的目的是什么sun.jnu.encoding
?网络上的各种片段设置或报告它,但我找不到定义。
回答by McDowell
I believe that this value represents the system encoding, which may be different from the user encoding ("file.encoding") on some platforms. The "sun" prefix makes me suspect that this is an implementation detail specific to the Sun JRE (a quick look at an IBM 1.4 VM shows an "ibm.system.encoding" system property). I have no idea on how this might be used internally - though I'm sure a quick look through the sourcewould yield some clues.
我相信这个值代表了系统编码,在某些平台上可能与用户编码(“file.encoding”)不同。“sun”前缀让我怀疑这是特定于 Sun JRE 的实现细节(快速浏览 IBM 1.4 VM 会显示“ibm.system.encoding”系统属性)。我不知道如何在内部使用它 - 尽管我确信快速浏览源代码会产生一些线索。
回答by asdfasdg
see http://happygiraffe.net/blog/2009/09/24/java-platform-encoding/
见http://happygiraffe.net/blog/2009/09/24/java-platform-encoding/
This link describes the usage of the sun.jnu.encoding
property for using the correct encoding when parsing values passed via the commandline, something that setting the file.encoding
property doesn't influence.
此链接描述了sun.jnu.encoding
在解析通过命令行传递的值时使用正确编码的属性的用法,设置file.encoding
属性不会影响的东西。
回答by siddagrl
I did some investigation on encoding and as per my analysis
根据我的分析,我对编码进行了一些调查
- sun.jnu.encoding affects the creation of file name (this possibly gets set by LANG on unix before starting java)
- file.encoding affects the content of a file
- sun.jnu.encoding 影响文件名的创建(这可能在启动 java 之前由 unix 上的 LANG 设置)
- file.encoding 影响文件的内容