We're updating the issue view to help you get more done. 

DecimalFormat.applyLocalizedPattern() ignores custom zero digit

Description

DecimalFormat.applyLocalizedPattern() doesn't consider a user-set zero digit when parsing the pattern, when it did in ICU 58.

This JUnit test passes on ICU 58 and fails with 59:

1 2 3 4 5 6 7 8 9 10 11 12 13 @Test public void test_DecimalFormat_applyLocalizedPattern_custom_zero_digit() { DecimalFormatSymbols dfs = new DecimalFormatSymbols(Locale.US); dfs.setDigitStrings(new String[] { // Gujarati Digits "\u0AE6", "\u0AE7", "\u0AE8", "\u0AE9", "\u0AEA", "\u0AEB", "\u0AEC", "\u0AED", "\u0AEE", "\u0AEF", }); DecimalFormat format = new DecimalFormat("#", dfs); // This should be equivalent to applyPattern("0") format.applyLocalizedPattern("\u0AE6"); assertEquals("\u0AE8", format.format(2)); }

Environment

Status

Assignee

Shane Carr

Reporter

TracBot

tracCc

roubert,shane

tracCreated

Jun 07, 2017, 4:24 PM

tracOwner

shane

tracProject

ICU4J

tracReporter

Joachim Sauer <jsauer@45913043a294ac57

tracResolution

fixed

tracReviewer

andy

tracStatus

closed

Components

Fix versions

Priority

medium