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

Locale issues with Mac 10.12

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: core-libs
    • Subcomponent:
    • Resolved In Build:
      b158
    • CPU:
      x86
    • OS:
      os_x

      Backports

        Description

        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.

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved: