MBCS related changes for CLDR 48.0 update in JDK26#6904
Open
rishabh-ibm wants to merge 2 commits intoadoptium:v1.0.12-releasefrom
Open
MBCS related changes for CLDR 48.0 update in JDK26#6904rishabh-ibm wants to merge 2 commits intoadoptium:v1.0.12-releasefrom
rishabh-ibm wants to merge 2 commits intoadoptium:v1.0.12-releasefrom
Conversation
1. JDK 26 removed the unused `sun.nio.cs.ArrayEncoder::encode` method as part of cleanup, causing CharsetsTest to fail. **JDK-8363925: Remove unused sun.nio.cs.ArrayEncoder::encode** 🔗 https://bugs.openjdk.org/browse/JDK-8363925 | Aspect | JDK < 26 (Old API) | JDK 26+ (New API) | |--------|-------------------|-------------------| | **Method** | `encode()` | `encodeFromUTF16()` | | **Input Type** | `char[]` array | UTF-16 LE `byte[]` array | | **Signature** | `encode(char[] src, int srcOff, int srcLen, byte[] dst)` | `encodeFromUTF16(byte[] src, int srcOff, int srcLen, byte[] dst, int dstOff)` | | **Parameters** | 4 parameters | 5 parameters (added dstOff) | The old `encode(char[])` method was unused in the JDK codebase and was removed as part of code cleanup. The new `encodeFromUTF16(byte[])` method provides better performance and more control over encoding by working directly with UTF-16 encoded bytes. Version detection utility to determine JDK feature version at runtime. ```java public static long getFeature() { return feature; // Returns 21, 26, etc. } 2. CLDR 48.0 changed the SeparateKeyValue display format from capitalized phrases to lowercase with colon separators. Changes: Updated expected display format in 5 test files JDK25 and below: "First Day of Week Is Monday" JDK26 and above: "First day of week: Monday" References: JDK-8354550 - Update CLDR to Version 48.0 CLDR 48.0 Release: https://cldr.unicode.org/index/downloads/cldr-48 3. fixes the `DateFormatTest` failure for zh_TW locale caused by CLDR 48.0 format changes in JDK 26. **Root Cause:** CLDR 48.0 changed the date-time format patterns for Chinese (Taiwan) locale, specifically: 1. Removed the space between date and time components 2. Changed bracket notation to use single quotes for literal characters **Changes Made:** Updated `ResourceBundleTest_zh_TW.java` with corrected date format patterns: | Format | Old Pattern | New Pattern (CLDR 48.0) | |--------|-------------|-------------------------| | FULL | `y年M月d日 EEEE ah:mm:ss [zzzz]` | `y年M月d日 EEEEah:mm:ss '['zzzz']'` | | LONG | `y年M月d日 ah:mm:ss [z]` | `y年M月d日ah:mm:ss '['z']'` | | MEDIUM | `y年M月d日 ah:mm:ss` | `y年M月d日ah:mm:ss` | | SHORT | `y/M/d ah:mm` | `y/M/dah:mm` | **Testing:** ✅ Verified with JDK 26 - DateFormatTest now passes with "OK" status for zh_TW locale **References:** - JDK-8354550 - Update CLDR to Version 48.0 - CLDR 48.0 Release: https://cldr.unicode.org/index/downloads/cldr-48 - CLDR Date/Time Patterns: https://unicode.org/reports/tr35/tr35-dates.html#Date_Format_Patterns Signed-off-by: Rishabh Thakur <rishabh@ibm.com>
Contributor
Author
|
This is the related PR for release branch. Please assign, approve and merge it. |
karianna
requested changes
Feb 16, 2026
Updated better logging mechanism in CharsetsTest class. Signed-off-by: Rishabh Thakur <rishabh@ibm.com>
Member
|
The change should not first be merged to the v1.0.12-release branch. It should be first merged to master and then the same change ported to the v1.0.12-release branch. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of MBCS Test Changes for JDK 26 Compatibility
This PR addresses three JDK 26 compatibility issues in MBCS tests caused by upstream API and data changes.
1. CharsetsTest - ArrayEncoder API Change
Problem:
JDK 26 removed
sun.nio.cs.ArrayEncoder::encodemethod, breaking CharsetsTest.Reference: JDK-8363925
API Changes:
encode()encodeFromUTF16()char[]byte[]encode(char[], int, int, byte[])encodeFromUTF16(byte[], int, int, byte[], int)Solution:
Added JavaVersion utility for runtime version detection. Tests now use appropriate API based on JDK version.
Files:
functional/MBCS_Tests/charsets/src/CharsetsTest.javafunctional/MBCS_Tests/charsets/src/JavaVersion.java2. Language Tag Tests - CLDR 48.0 Display Format
Problem:
CLDR 48.0 changed locale display format from capitalized to lowercase with colons.
Changes:
"First Day of Week Is Monday""First day of week: Monday"Files Modified:
functional/MBCS_Tests/language_tag/src/CNTagTest.javafunctional/MBCS_Tests/language_tag/src/USTagTest.javafunctional/MBCS_Tests/language_tag/src/JPTagTest.javafunctional/MBCS_Tests/language_tag/src/KRTagTest.javafunctional/MBCS_Tests/language_tag/src/TWTagTest.javaReference: CLDR 48.0
3. i18n zh_TW DateFormat - CLDR 48.0 Pattern Changes
Problem:
CLDR 48.0 changed zh_TW date format patterns, causing DateFormatTest failures.
Pattern Changes:
y年M月d日 EEEE ah:mm:ss [zzzz]y年M月d日 EEEEah:mm:ss '['zzzz']'y年M月d日 ah:mm:ss [z]y年M月d日ah:mm:ss '['z']'y年M月d日 ah:mm:ssy年M月d日ah:mm:ssy/M/d ah:mmy/M/dah:mmKey Changes:
Files:
functional/MBCS_Tests/i18n/src/DateFormatTest.javafunctional/MBCS_Tests/i18n/src/ResourceBundleTest_zh_TW.javafunctional/MBCS_Tests/i18n/src/ResourceBundleTest_26_zh_TW.javaReferences:
Test Results
JDK 26:
JDK 21:
Summary
Files Modified: 10
Files Created: 3
Backward Compatible: Yes
All Tests Pass: JDK 21 and JDK 26
Signed-off-by: Rishabh Thakur rishabh@ibm.com