[AIX] Add charset IBM-964 (default charset for zh_TW.IBM-eucTW) to stdcs
Bhaktavatsal R Maram
bhamaram at in.ibm.com
Thu May 10 13:35:02 UTC 2018
Hi All,
In bug 8201540 (Extend the set of supported charsets in java.base on AIX)[1] we moved default charsets that are available in OpenJDK to java.base module except to IBM964. Charset IBM964 is bit tricky. Its Encoder is extended from sun.nio.cs.ext.SimpleEUCEncoder. So, SimpleEUCEncoder also should be moved along with IBM964 to sun.nio.cs. However, there is another charset IBM33722 which should always in sun.nio.cs.ext whose encoder also extends SimpleEUCEncoder.
Hence, the challenge is that sun.nio.cs.ext.IBM33722 should import SimpleEUCEncoder from either sun.nio.cs or sun.nio.cs.ext based on the location of IBM964.
On AIX, following should be the package locations
sun.nio.cs.IBM964
sun.nio.cs.SimpleEUCEncoder
sun.nio.cs.ext.IBM33722 imports sun.nio.cs.SimpleEUCEncoder
On Linux (and other platforms), following should be the package locations
sun.nio.cs.ext.IBM964
sun.nio.cs.ext.SimpleEUCEncoder
sun.nio.cs.ext.IBM33722 imports sun.nio.cs.ext.SimpleEUCEncoder
To achieve this, I've changed all source files involved to templates. And, I also modified build tools to check if IBM964 is moved to stdcs or not and handled import statement of SimpleEUCEncoder in sun.nio.cs.ext.IBM33722 accordingly.
Patch can be found here [2]. Please review. After jira bug is opened, I'll host it again with bug ID.
With this change, java -version is successful on locale zh_TW.IBM-eucTW.
-bash-4.4$ LANG=zh_TW.IBM-eucTW ~/openjdk/jdk11/build/aix-ppc64-normal-server-release/jdk/bin/java -version
openjdk version "11-internal" 2018-09-25
OpenJDK Runtime Environment (build 11-internal+0-adhoc.bhamaram.jdk11)
OpenJDK 64-Bit Server VM (build 11-internal+0-adhoc.bhamaram.jdk11, mixed mode)
[1] https://bugs.openjdk.java.net/browse/JDK-8201540
[2] http://cr.openjdk.java.net/~aleonard/AIXIBM964/webrev.01/
Thanks,
Bhaktavatsal Reddy
More information about the core-libs-dev
mailing list