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

Locale issues with Mac 10.12

XMLWordPrintable

    • b158
    • x86
    • os_x

        With Mac 10.12 there are some locale issues with Simplified and traditional chinese.
        Locale.getDefault() returns zh-hans-us / zh-hant-us for the above languages
        The above causes some issues when we format a date instance.

        Date currentDate = new Date();
        String date = DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.getDefault()).format(currentDate);

        The above code throws an exception "ill-fomed language: zh-hans-us" for simplified chinese - Mac 10.12 and JDK9 b 155

        These languages were earlier handled as zh_TW/zh_CN

        Also if run as a standalone java class, DateFormat.MEDIUM does not show any Chinese characters, DateFormat.LONG shows Chinese characters.

              naoto Naoto Sato
              vrao Vivek Rao (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: