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

Incorrect spelling of month name in locale for Belarusian language ("be", "BY")

XMLWordPrintable

    • b80
    • x86
    • windows_xp
    • Verified

      FULL PRODUCT VERSION :
      java version "1.6.0_01"
      Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
      Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Belarusian region and language in system regional settings.

      A DESCRIPTION OF THE PROBLEM :
      Incorrect spelling of the November month name in the locale for the Belarusian language ("be", "BY") for the full date display format.

      wrong=\u043b\u0438\u0441\u0442\u0430\u043f\u0430\u0434\u0430
      correct=\u043b\u0456\u0441\u0442\u0430\u043f\u0430\u0434\u0430

      UTF-8:
      wrong=¿¿¿¿¿¿¿¿¿
      correct=¿¿¿¿¿¿¿¿¿


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Use the source code below.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      \u043b\u0456\u0441\u0442\u0430\u043f\u0430\u0434\u0430

      For month name("UTF-8:¿¿¿¿¿¿¿¿¿")
      ACTUAL -
      \u043b\u0438\u0441\u0442\u0430\u043f\u0430\u0434\u0430

      For month name("UTF-8:¿¿¿¿¿¿¿¿¿")


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.text.DateFormat;
      import java.text.ParseException;
      import java.util.Calendar;
      import java.util.GregorianCalendar;
      import java.util.Locale;
      import java.util.logging.Level;
      import java.util.logging.Logger;
      import javax.swing.text.DateFormatter;

      public class Main {

          /**
           * @param args the command line arguments
           */
          public static void main(String[] args) {
              Locale belarusianLocale = new Locale("be");
              Locale.setDefault(belarusianLocale);
              
              
              
              String fd = "no format";
              try {
                  GregorianCalendar cal = new GregorianCalendar();
                  cal.set(Calendar.MONTH, Calendar.NOVEMBER);

                  DateFormat dfmt = DateFormat.getDateInstance(DateFormat.FULL);

                  DateFormatter f = new DateFormatter(dfmt);
                  fd = f.valueToString(cal.getTime());
              } catch (ParseException ex) {
                  Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
              }

              System.out.println("date = " + fd);
              
          }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      I don't know a better work around except of scanning the produced output and replacing the wrong substring.

            katakai Masaki Katakai
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: