简体   繁体   English

Javac编码选项

[英]Javac -encoding options

Where can I find a complete listing of all the character encodings supported by the javac command? 在哪里可以找到javac命令支持的所有字符编码的完整清单?

I have found suggestions of how to specify the encoding that a file uses with the -encoding flag in other answers, which contain several useful examples of supported encodings encountered commonly in the wild. 我在其他答案中找到了有关如何通过-encoding标志指定文件使用的-encoding ,其中包含一些在野外常见的受支持编码的有用示例。 I think it would also be useful if an exhaustive list was documented somewhere, and I have not found one. 我认为,如果在某处记录了详尽的清单,而我还没有找到详尽的清单,那也将很有用。

Perhaps it depends on the version of javac ? 也许这取决于javac的版本? Perhaps also it coincides completely with the number of encodings that the java standard library has support for? 也许它也与Java标准库支持的编码数量完全一致? I suppose the first step is to generate a list of encodings which are supported by the library, which has been done , but even if this is done it's not completely clear we'd be left with an exhaustive list. 我想第一步是生成库支持的编码列表,此列表已经完成了 ,但是即使这样做还不完全清楚,我们仍会留下一个详尽的列表。

Each J2SE version will list its supported encoding sets. 每个J2SE版本都将列出其支持的编码集。 For example, this show the encoding sets supported by Java SE 7 例如,此图显示了Java SE 7支持编码集

javac is the compiler, encoding sets doesn't depend upon compiler version but each release will list its supported encoding sets. javac是编译器,编码集不依赖于编译器版本,但是每个发行版都会列出其支持的编码集。

Hope this helps! 希望这可以帮助!

The link above gives the required minimum: "The java.io.InputStreamReader, java.io.OutputStreamWriter, java.lang.String classes, and classes in the java.nio.charset package can convert between Unicode and a number of other character encodings. The supported encodings vary between different implementations of the Java Platform, Standard Edition 7 (Java SE 7). The class description for java.nio.charset.Charset lists the encodings that any implementation of the Java Platform, Standard Edition 7 is required to support." 上面的链接给出了所需的最低要求:“ java.io.InputStreamReader,java.io.OutputStreamWriter,java.lang.String类以及java.nio.charset包中的类可以在Unicode和许多其他字符编码之间进行转换。该支持的编码的Java平台,标准版7(Java SE 7中)的不同实施之间变化。对于java.nio.charset.Charset中的类描述列出了Java平台的任何实施方式中,标准版7是需要的编码支持。”

See availableCharsets which gives the collection of all character encodings actually supported by the implementation you happen to be using. 请参见availableCharsets ,该集合提供了您碰巧正在使用的实现实际支持的所有字符编码的集合。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM