-
Bug
-
Resolution: Not an Issue
-
P3
-
None
-
11
-
x86_64
-
windows_7
A DESCRIPTION OF THE PROBLEM :
The group separator for language format German, region Switzerland (de_CH) changed from Java 10 to Java 11.
In 10, it was correctly a ' (ASCII 39), in Java 11 it prints a ’ (ASCII 8217?) instead. This is wrong, ASCII 39 was the correct character. Was this change intentional?
REGRESSION : Last worked in version 10.0.2
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile attached source code, run once on Java 11 and one on Java 10.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Thousands separator is ' ASCII code 39. Currency format: 1'234.56
ACTUAL -
Thousands separator is ASCII code 8217. Currency format: 1’234.56
---------- BEGIN SOURCE ----------
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.Locale;
public class SwissCurrencyFormatTest {
public static void main( String[] args ) {
DecimalFormat formatter = ( DecimalFormat) NumberFormat.getInstance( new Locale( "de", "CH" ) );
formatter.applyPattern( "###,###.##" );
char separator = formatter.getDecimalFormatSymbols().getGroupingSeparator();
System.out.println( "Thousands separator is " + separator + " ASCII code " + ( int) separator + ". Currency format: " + formatter.format( 1234.56 ) );
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
formatter.getDecimalFormatSymbols().setGroupingSeparator('\'');
FREQUENCY : always
The group separator for language format German, region Switzerland (de_CH) changed from Java 10 to Java 11.
In 10, it was correctly a ' (ASCII 39), in Java 11 it prints a ’ (ASCII 8217?) instead. This is wrong, ASCII 39 was the correct character. Was this change intentional?
REGRESSION : Last worked in version 10.0.2
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile attached source code, run once on Java 11 and one on Java 10.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Thousands separator is ' ASCII code 39. Currency format: 1'234.56
ACTUAL -
Thousands separator is ASCII code 8217. Currency format: 1’234.56
---------- BEGIN SOURCE ----------
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.Locale;
public class SwissCurrencyFormatTest {
public static void main( String[] args ) {
DecimalFormat formatter = ( DecimalFormat) NumberFormat.getInstance( new Locale( "de", "CH" ) );
formatter.applyPattern( "###,###.##" );
char separator = formatter.getDecimalFormatSymbols().getGroupingSeparator();
System.out.println( "Thousands separator is " + separator + " ASCII code " + ( int) separator + ". Currency format: " + formatter.format( 1234.56 ) );
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
formatter.getDecimalFormatSymbols().setGroupingSeparator('\'');
FREQUENCY : always