[AIX] Add charset IBM-964 (default charset for zh_TW.IBM-eucTW) to stdcs

Xueming Shen xueming.shen at oracle.com
Fri May 11 16:12:44 UTC 2018


SimpleEUCEncoder is something leftover when I reimplemented the charsets 
to be
map-based-built-during-build-time. I would recommend to leave them as 
Bhaktavatsal
suggested for now. Ideally any new charsets added to the platform needs 
to be based on
the new model (open/make/data/charetmapping), instead of hard-coding the map
into the source code.

Thanks!
Sherman

On 5/10/18, 8:20 PM, Bhaktavatsal R Maram wrote:
> Hi Ichiroh,
>
> Yes, moving SimpleEUCEncoder.java to sun.nio.cs package would leave build tools untouched. But, I think that for platforms other than AIX, SimpleEUCEncoder.java in java.base module would not add any value.
>
> - Bhaktavatsal
>
> -----Ichiroh Takiguchi<takiguc at linux.vnet.ibm.com>  wrote: -----
> To: Bhaktavatsal R Maram/India/IBM at IBMIN
> From: Ichiroh Takiguchi<takiguc at linux.vnet.ibm.com>
> Date: 05/11/2018 06:31AM
> Cc: Java Core Libs<core-libs-dev at openjdk.java.net>
> Subject: Re: [AIX] Add charset IBM-964 (default charset for zh_TW.IBM-eucTW) to stdcs
>
> Hello Bhaktavatsal.
>
> I think we should move
> from
>     src/jdk.charsets/share/classes/sun/nio/cs/ext/SimpleEUCEncoder.java
> to
>     src/java.base/share/classes/sun/nio/cs/SimpleEUCEncoder.java
> instead of moving to
>
> src/jdk.charsets/share/classes/sun/nio/cs/ext/SimpleEUCEncoder.java.template
>
> Then we don't need to touch following files
>     make/jdk/src/classes/build/tools/charsetmapping/Main.java
>     make/jdk/src/classes/build/tools/charsetmapping/SRC.java
>
> I think SimpleEUCEncoder.java is not large file,
> so it can be moved to java.base module.
>
> What do you think ?
>
> On 2018-05-10 22:35, Bhaktavatsal R Maram wrote:
>> 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