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

JRE1.8.0_92 -Application log file to show chineses character when used chinese l

XMLWordPrintable

      When system locale is set to Chinese the issue happens.
      The MONTH AM PM getting printed in ?? an not printed in chinese.

      the output is -
      >> ?? 01, 2016 12:12:17 ?? test.swing.LoggerTest test
      >> ??: This is a Chinese locale: zh_CN

      But when locale is set to english there are no issues.

      Here is the sample test case:

      ---------- BEGIN SOURCE ----------
      import java.util.Locale;
      import java.util.logging.Level;
      import java.util.logging.Logger;

      public class LoggerTest {

          private static final Logger LOGGER = Logger
                  .getLogger(LoggerTest.class.getName());

          public static void main(String[] args) {

              LoggerTest loggerTest = new LoggerTest();
              loggerTest.test();
          }

          private void test() {

              LOGGER.log(Level.INFO, "This is a English locale: {0}",
                      new Object[] { Locale.getDefault() });
              System.out.println();

              Locale chineseLocale = new Locale("zh", "CN");
              Locale.setDefault(chineseLocale);
              LOGGER.log(Level.INFO, "This is a Chinese locale: {0}",
                      new Object[] { Locale.getDefault() });
              System.out.println();
          }
      }


      ---------- END SOURCE ----------


            rpatil Ramanand Patil (Inactive)
            shadowbug Shadow Bug
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: