0xFB29, 0xFB29,
0xFE62, 0xFE62,
0xFF0B, 0xFF0B).freeze();
-
+
+ // equivalent grouping and decimal support
+ static final boolean skipExtendedSeparatorParsing = ICUConfig.get(
+ "com.ibm.icu.text.DecimalFormat.SkipExtendedSeparatorParsing", "false")
+ .equals("true");
+
// When parsing a number with big exponential value, it requires to transform the
// value into a string representation to construct BigInteger instance. We want to
int digitStart = position; // where did the digit start?
int gs2 = groupingSize2 == 0 ? groupingSize : groupingSize2;
- // equivalent grouping and decimal support
- boolean skipExtendedSeparatorParsing = ICUConfig.get(
- "com.ibm.icu.text.DecimalFormat.SkipExtendedSeparatorParsing", "false")
- .equals("true");
-
UnicodeSet decimalEquiv = skipExtendedSeparatorParsing ? UnicodeSet.EMPTY :
getEquivalentDecimals(decimal, strictParse);
UnicodeSet groupEquiv = skipExtendedSeparatorParsing ? UnicodeSet.EMPTY :
import java.util.Set;
import com.ibm.icu.dev.test.TestUtil;
+import com.ibm.icu.impl.ICUConfig;
import com.ibm.icu.impl.LocaleUtility;
import com.ibm.icu.impl.data.ResourceReader;
import com.ibm.icu.impl.data.TokenIterator;
expect(fmt, "2\uFF61345.67", 2345.67);
- // Ticket#7218
+ // Ticket#7128
//
- // Lenient separator parsing is enabled by default.
- // A space character below is interpreted as a
- // group separator, even ',' is used as grouping
- // separator in the symbols.
sym.setGroupingSeparator(',');
fmt.setDecimalFormatSymbols(sym);
- expect(fmt, "12 345", 12345);
-
- // When the property SkipExtendedSeparatorParsing is true,
- // DecimalFormat does not use the extended equivalent separator
- // data and only uses the one in DecimalFormatSymbols.
- System.setProperty("com.ibm.icu.text.DecimalFormat.SkipExtendedSeparatorParsing", "true");
-
- expect(fmt, "23 456", 23);
-
- // Set the configuration back to the default
- System.setProperty("com.ibm.icu.text.DecimalFormat.SkipExtendedSeparatorParsing", "false");
+ String skipExtSepParse = ICUConfig.get("com.ibm.icu.text.DecimalFormat.SkipExtendedSeparatorParsing", "false");
+ if (skipExtSepParse.equals("true")) {
+ // When the property SkipExtendedSeparatorParsing is true,
+ // DecimalFormat does not use the extended equivalent separator
+ // data and only uses the one in DecimalFormatSymbols.
+ expect(fmt, "23 456", 23);
+ } else {
+ // Lenient separator parsing is enabled by default.
+ // A space character below is interpreted as a
+ // group separator, even ',' is used as grouping
+ // separator in the symbols.
+ expect(fmt, "12 345", 12345);
+ }
}
/*