Step 1: Add at the top of the pageimport="java.util.*"
ResourceBundle res = ResourceBundle.getBundle("properties.resource");
Step 2:
third step:
Remarks: Chinese garbled solution
1. Solution 1: When using keyValue, perform encoding conversion
view plaincopy to clipboardprint?
String keyValue = new String(rb.getString(keyName).getBytes("ISO-8859-1"), "GBK");
String keyValue = new String(rb.getString(keyName).getBytes(“ISO-8859-1”), “UTF-8”);
2. Solution 2: Convert machine_zh_CN.properties to unicode form
native2ascii.exe machine_zh_CN.properties machine_zh_CN.txt
p1=/u51b0/u7bb1 p2=/u6d17/u8863/u673a p3=/u7535/u89c6/u673a