Creating a charset provider module for IBM charsets
Dave Hobbs
dave_hobbs at uk.ibm.com
Wed Jun 20 14:52:13 UTC 2018
Hi Alan,
My understanding is that java.base only exports sun.nio.cs to jdk.charsets
i.e java.base module-info.java has:
...
exports sun.nio.cs to
java.desktop,
jdk.charsets;
...
and jdk.charsets has:
module jdk.charsets {
provides java.nio.charset.spi.CharsetProvider with
sun.nio.cs.ext.ExtendedCharsets;
}
So jdk.charsets can use sun.nio.cs, whereas my module can not.
Am I missing something?
Dave
From: Alan Bateman <Alan.Bateman at oracle.com>
To: Dave Hobbs <dave_hobbs at uk.ibm.com>, core-libs-dev at openjdk.java.net
Date: 20/06/2018 14:26
Subject: Re: Creating a charset provider module for IBM charsets
On 20/06/2018 14:22, Dave Hobbs wrote:
> Hi
>
> We would like to migrate a number of the IBM charsets (which don't need
to
> be in java.base) to a modular charset provider.
>
> However, as written today our charset classes rely on sun.nio.cs classes
> and definitions, which are no longer visible. For example:
>
> sun.nio.cs.HistoricallyNamedCharset;
>
> sun.nio.cs.CharsetMapping.UNMAPPABLE_DECODING;
> sun.nio.cs.CharsetMapping.UNMAPPABLE_ENCODING;
>
> sun.nio.cs.ArrayDecoder;
> sun.nio.cs.ArrayEncoder;
>
> sun.nio.cs.Surrogate.Parser;
>
> sun.nio.cs.SingleByte.Decoder;
> sun.nio.cs.ext.DoubleByte.Decoder;
>
> sun.nio.cs.SingleByteDecoder;
> sun.nio.cs.SingleByteEncoder;
>
> Are there any alternatives to these classes in the new module system or
an
> alternative approach to creating charsets?
Can you use jdk.charsets as an example? You'll see that java.base
exports these packages to the service provider module.
-Alan
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number
741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
More information about the core-libs-dev
mailing list