Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8160808

java.lang.String.format(String format, Object... args) doesn't return expected string when use format string %d in ar_SA locale

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 9, 10
    • Fix Version/s: tbd
    • Component/s: core-libs
    • Labels:

      Description

      Build: jdk 9 b125
      OS: Oracle Linux 6.5/macosx 10.9

      Steps:
      1. Use format string %d, and integer i=1 as args
      2. Invoke the method String.format(String format, Object... args)

      Expected result:
      the string is formatted as 1.

      Actual result:
      if set LC_ALL and LANG to en_US/zh_CN/de_DE, the result is 1, in ar_SA, result is garbled string.

      Sample code:
      public class test{
            public static void main(String[] args){
                    int i=1;
                    String actual = String.format("%d",i);
                    System.out.println(actual);
            }
      }

      Additional information:
      the sample code works as expected in latest 8u111 b02
      this bug reproduces in 9 b110/b85

        Attachments

          Activity

            People

            • Assignee:
              bchristi Brent Christian
              Reporter:
              yliu Johnny Liu (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated: