Lifting GB2312 to GB18030

This commit is contained in:
Glavo 2021-12-13 13:13:34 +08:00 committed by Yuhui Huang
parent 3a5e8a827c
commit fbf7ff6ebd

View File

@ -124,9 +124,10 @@ public enum OperatingSystem {
if (nativeEncoding != null && !nativeEncoding.equalsIgnoreCase(nativeCharset.name())) { if (nativeEncoding != null && !nativeEncoding.equalsIgnoreCase(nativeCharset.name())) {
nativeCharset = Charset.forName(nativeEncoding); nativeCharset = Charset.forName(nativeEncoding);
} }
if (nativeCharset == StandardCharsets.UTF_8 || nativeCharset == StandardCharsets.US_ASCII) { if (nativeCharset == StandardCharsets.UTF_8 || nativeCharset == StandardCharsets.US_ASCII) {
nativeCharset = StandardCharsets.UTF_8; nativeCharset = StandardCharsets.UTF_8;
} else if ("GBK".equalsIgnoreCase(nativeCharset.name())) { } else if ("GBK".equalsIgnoreCase(nativeCharset.name()) || "GB2312".equalsIgnoreCase(nativeCharset.name())) {
nativeCharset = Charset.forName("GB18030"); nativeCharset = Charset.forName("GB18030");
} }
} }