mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8301119: Support for GB18030-2022
Reviewed-by: alanb, coffeys, lancea
This commit is contained in:
parent
55e6bb6b85
commit
a253b46021
14 changed files with 232 additions and 156 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
|
@ -58,8 +58,13 @@ public class StandardCharsets extends CharsetProvider {
|
|||
}
|
||||
|
||||
private String canonicalize(String csn) {
|
||||
String acn = aliasMap().get(csn);
|
||||
return (acn != null) ? acn : csn;
|
||||
if (csn.startsWith("gb18030-")) {
|
||||
return csn.equals("gb18030-2022") && !GB18030.IS_2000 ||
|
||||
csn.equals("gb18030-2000") && GB18030.IS_2000 ? "gb18030" : csn;
|
||||
} else {
|
||||
String acn = aliasMap().get(csn);
|
||||
return (acn != null) ? acn : csn;
|
||||
}
|
||||
}
|
||||
|
||||
private Map<String,String> aliasMap() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue