简体   繁体   中英

Javac -encoding options

Where can I find a complete listing of all the character encodings supported by the javac command?

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. 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 ? Perhaps also it coincides completely with the number of encodings that the java standard library has support for? 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. For example, this show the encoding sets supported by Java SE 7

javac is the compiler, encoding sets doesn't depend upon compiler version but each release will list its supported encoding sets.

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."

See availableCharsets which gives the collection of all character encodings actually supported by the implementation you happen to be using.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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