8212794: IBM-964 is required for AIX default charset

Reviewed-by: rriggs, ihse, alanb
This commit is contained in:
Ichiroh Takiguchi 2018-12-06 10:22:23 -05:00
parent 2e724a371a
commit eee1a6fab0
6 changed files with 35 additions and 9 deletions

View File

@ -1554,10 +1554,11 @@ charset x-IBM970 IBM970
charset x-IBM964 IBM964
package sun.nio.cs.ext
type source
type template
alias cp964 # JDK historical
alias ibm964
alias ibm-964
alias ibm-euctw
alias 964
charset x-IBM33722 IBM33722
@ -1861,6 +1862,11 @@ charset x-JIS0212_MS5022X JIS_X_0212_MS5022X
minmax 0x21 0x7e 0x21 0x7e
internal true # "internal implementation
charset SimpleEUCEncoder SimpleEUCEncoder
package sun.nio.cs.ext
type template
internal true
########################################################
#
# platform specific charsets, to be registered into spi

View File

@ -16,6 +16,7 @@ IBM942C
IBM943
IBM943C
IBM950
IBM964
IBM970
IBM1046
IBM1124
@ -25,3 +26,4 @@ ISO_8859_6
ISO_8859_8
MS1252
TIS_620
SimpleEUCEncoder

View File

@ -1,6 +1,6 @@
/*
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2018, 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
@ -36,6 +36,7 @@ import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CoderResult;
import sun.nio.cs.HistoricallyNamedCharset;
import sun.nio.cs.*;
public class IBM33722
extends Charset

View File

@ -1,6 +1,6 @@
/*
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2018, 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.CharBuffer;
import java.nio.ByteBuffer;
@ -43,7 +43,7 @@ public class IBM964
{
public IBM964() {
super("x-IBM964", ExtendedCharsets.aliasesFor("x-IBM964"));
super("x-IBM964", $ALIASES$);
}
public String historicalName() {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2018, 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
@ -26,7 +26,7 @@
/*
*/
package sun.nio.cs.ext;
package $PACKAGE$;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2018, 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,7 +22,7 @@
*/
/* @test
* @bug 6371437 6371422 6371416 6371619 5058184 6371431 6639450 6569191 6577466
* @bug 6371437 6371422 6371416 6371619 5058184 6371431 6639450 6569191 6577466 8212794
* @summary Check if the problems reported in above bugs have been fixed
* @modules jdk.charsets
*/
@ -234,6 +234,22 @@ public class TestIBMBugs {
}
}
private static void bug8212794 () throws Exception {
Charset cs = Charset.forName("x-IBM964");
byte[] ba = new byte[] {(byte)0x5c, (byte)0x90, (byte)0xa1, (byte)0xa1};
char[] ca = new char[] {'\\', '\u0090', '\u3000'};
ByteBuffer bb = ByteBuffer.wrap(ba);
CharBuffer cb = cs.decode(bb);
if(!Arrays.equals(ca, Arrays.copyOf(cb.array(), cb.limit()))) {
throw new Exception("IBM964 failed to decode");
}
cb = CharBuffer.wrap(ca);
bb = cs.encode(cb);
if(!Arrays.equals(ba, Arrays.copyOf(bb.array(), bb.limit()))) {
throw new Exception("IBM964 failed to encode");
}
}
public static void main (String[] args) throws Exception {
bug6577466();
// need to be tested before any other IBM949C test case
@ -245,6 +261,7 @@ public class TestIBMBugs {
bug6371431();
bug6569191();
bug8202329();
bug8212794();
bug8213618();
}
}