提交 dcd67363 编写于 作者: I itakiguchi

8242541: Small charset issues (ISO8859-16, x-eucJP-Open, x-IBM834 and x-IBM949C)

Summary: Modify ISO8859-16, x-eucJP-Open, x-IBM834 and x-IBM949C charset related files
Reviewed-by: naoto
上级 22668a17
#
# Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
......@@ -282,6 +282,7 @@ charset ISO-8859-16 ISO_8859_16
alias iso-ir-226
alias ISO_8859-16:2001
alias ISO_8859-16
alias ISO8859_16
alias latin10
alias l10
alias csISO885916
......@@ -702,7 +703,7 @@ charset x-euc-jp-linux EUC_JP_LINUX
charset x-eucJP-Open EUC_JP_Open
package sun.nio.cs.ext
type template
hisname EUC_JP_Solari
hisname EUC_JP_Solaris
ascii true
alias EUC_JP_Solaris # JDK historical
alias eucJP-open
......@@ -1396,7 +1397,7 @@ charset x-IBM833 IBM833
charset x-IBM834 IBM834 # EBCDIC DBCS-only Korean
package sun.nio.cs.ext
type source
type template
alias cp834
alias ibm834
alias 834
......@@ -1490,7 +1491,7 @@ charset x-IBM949 IBM949
charset x-IBM949C IBM949C
package sun.nio.cs.ext
type source
type template
alias cp949C # JDK historical
alias ibm949C
alias ibm-949C
......
/*
* Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -27,7 +27,7 @@
/*
*/
package sun.nio.cs.ext;
package $PACKAGE$;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
......@@ -41,7 +41,7 @@ import static sun.nio.cs.CharsetMapping.*;
public class IBM834 extends Charset
{
public IBM834() {
super("x-IBM834", ExtendedCharsets.aliasesFor("x-IBM834"));
super("x-IBM834", $ALIASES$);
}
public boolean contains(Charset cs) {
......
/*
* Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -23,7 +23,7 @@
* questions.
*/
package sun.nio.cs.ext;
package $PACKAGE$;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
......@@ -36,7 +36,7 @@ public class IBM949C extends Charset implements HistoricallyNamedCharset
{
public IBM949C() {
super("x-IBM949C", ExtendedCharsets.aliasesFor("x-IBM949C"));
super("x-IBM949C", $ALIASES$);
}
public String historicalName() {
......
/*
* Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -23,7 +23,7 @@
/* @test
* @bug 4473201 4696726 4652234 4482298 4784385 4966197 4267354 5015668
6911753 8071447 8186751
6911753 8071447 8186751 8242541
* @summary Check that registered charsets are actually registered
* @modules jdk.charsets
*/
......@@ -443,6 +443,7 @@ public class RegisteredCharsets {
"iso-ir-226",
"ISO_8859-16:2001",
"ISO_8859-16",
"ISO8859_16",
"latin10",
"l10",
"csISO885916"
......
/*
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -22,12 +22,14 @@
*/
/* @test
* @bug 4513767 4961027 6217210
* @bug 4513767 4961027 6217210 8242541
* @summary Checks canonical names match between old and (NIO) core charsets
* @modules jdk.charsets
*/
import java.io.InputStreamReader;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.charset.UnsupportedCharsetException;
public class CheckHistoricalNames {
static int failed = 0;
......@@ -294,6 +296,7 @@ public class CheckHistoricalNames {
checkMappedName("x-MacThai", "MacThai");
checkMappedName("x-MacTurkish", "MacTurkish");
checkMappedName("x-MacUkraine", "MacUkraine");
checkCharsetAndHistoricalName();
if (failed != 0)
throw new Exception("Test Failed: " + failed);
......@@ -315,4 +318,24 @@ public class CheckHistoricalNames {
failed++;
}
}
private static void checkCharsetAndHistoricalName() {
for (Charset cs : Charset.availableCharsets().values()) {
InputStreamReader isr = new InputStreamReader(System.in, cs);
String encoding = isr.getEncoding();
try {
Charset csHist = Charset.forName(encoding);
if (!cs.equals(csHist)) {
System.out.println("Failed charset name"
+ " - expected " + cs.name()
+ ", got " + csHist.name());
failed++;
}
} catch (UnsupportedCharsetException uce) {
System.out.println("Failed : charset - " + cs.name()
+ ", missing alias entry - " + encoding);
failed++;
}
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册