Experiment 2: Java code class file encoding comparison

Experimental purpose: Compare utf-8 and GBK java source and bytecode files

File content: Baidu space

Prediction result: source file size is inconsistent, bytecode is consistent

Experimental results:

 

1. The content of the text file is the same, through the file comparison

2. Through the binary comparison, it can be seen that the binary code compiled from the java source code is different. Baidu space to see the comparison

3.experiment2 can view the coded summons

4. The compiled bytecode is the same, and the encoding is utf-8. Note (when using the command line, you need to specify encoding, such as javac -encoding utf-8 ...)

5.javac -encoding ... determines which format encoding to read java files, java -Dfile.endocing .. determines which encoding the virtual machine converts the output to

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326754746&siteId=291194637