jdk/test/java/util/Locale/PrintDefaultLocale.java
author mfang
Wed, 17 Aug 2011 14:18:26 -0700
changeset 10294 8fcdae2a7ec7
parent 7668 d4a77089c587
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
7668
d4a77089c587 6962318: Update copyright year
ohair
parents: 6489
diff changeset
     2
 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
 * (C) Copyright IBM Corp. 1998 - All Rights Reserved
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
 * Portions copyright (c) 2007 Sun Microsystems, Inc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 * All Rights Reserved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 * The original version of this source code and documentation
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * is copyrighted and owned by Taligent, Inc., a wholly-owned
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * subsidiary of IBM. These materials are provided under terms
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * of a License Agreement between Taligent and Sun. This technology
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * is protected by multiple US and International patents.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * This notice and attribution to Taligent may not be removed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * Taligent is a registered trademark of Taligent, Inc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * Permission to use, copy, modify, and distribute this software
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * and its documentation for NON-COMMERCIAL purposes and without
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * fee is hereby granted provided that this copyright notice
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * appears in all copies. Please refer to the file "copyright.html"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * for further important copyright and licensing information.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
    @bug 4123370 4091969 4118731 4182108 4778440
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
    The "at-test" tag was removed from this file, because there's no way to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
    run this test in an automated test harness.  It depends on having various
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    different locales installed on the machine, and on Windows it depends
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
    on the user going to the "Regional Settings" control panel and changing
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
    the settings before running the test for each bug.  We can run this test
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    manually from time to time to ensure that there has been no regression,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
    but it's not automated. -- lwerner, 7/6/98
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
    INSTRUCTIONS FOR RUNNING THIS TEST
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
    ==================================
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
    This test is designed to check for problems in the JVM code that initializes the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    default Java locale (the locale returned by Locale.getDefault()) from the system
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    locale settings (or from command-line arguments).  Since detecting a regression
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    usually requires setting the environment up in some way prior to running the test,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
    this is a manual test.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
    The test simply prints out the internal ID and display name of the default Java locale,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    and the name of the default Java character encoding.  It passes if these are what
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    you expect them to be, and fails if they're not.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    Bug #4091969:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
        To test for bug #4091969, run this test on a Korean-localized version of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
        Windows, with the default locale set to Korean.  You should get "ko_KR"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
        as the default locale.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    Bug #4123370:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
        One part of bug #4123370 duplicates bug #4091969, which is covered by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
        instructions above.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
        To test the unique part of bug #4123370, use the "Regional Settings" control
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
        panel to set the currect locale to each of the different Spanish-language locales.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
        Run this test once for each Spanish-language locale.  You should see the appropriate
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
        locale ID and name for each locale.  Both "Spanish - Traditional Sort" and
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
        "Spanish - Modern Sort" should produce "es_ES" and "Spanish (Spain)".
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
    Bug #4118731:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
        The basic issue here was that we had changed so that calling getDisplayName()
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
        on a locale that didn't include a country code no longer included a country
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
        name (instead of picking a default country name, as before), which is the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
        right answer.  The problem is we weren't always getting back a system default
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
        locale from Solaris that includes a country code, even though we should.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
        To test this, set the system default locale to a locale that doesn't include
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
        a country code, such as "fr" or "de", using (in the C shell) "setenv LC_ALL fr"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
        (or whatever the locale ID you want is).  Running PrintDefaultLocale should
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
        still produce a locale ID, and a locale display name, that include a country
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
        code (and country name).  [Remember to make sure the locale is actually installed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
        first.]
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
        To test the specific complaint in the bug, use "setenv LC_ALL ja".  Also pay
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
        special attention to Solaris locale IDs that don't match the corresponding java
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
        locales, such as "su" (which should turn into "fi_FI"), "cz" (which should turn
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
        into "cs_CZ"), and "en_UK" (which should turn into "en_GB").
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    Bug #4079167:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
        Test this bug the same way you test bug #4118731.  Set the locale to each of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
        the specified locale IDs (e.g., "setenv LC_ALL japanese"), and then run
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
        PrintDefaultLocale.  You should get the following results:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
            Solaris ID  Java ID  Java display name     Encoding
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
            ==========  =======  ====================  ========
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
            japanese    ja_JP    Japanese (Japan)        --
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
            korean      ko_KR    Korean (South Korea)    --
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
            tchinese    zh_TW    Chinese (Taiwan)        --
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
            big5        zh_TW    Chinese (Taiwan)      Big5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
        (Where "--" is marked for "encoding," the result isn't important-- it's the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
        default encoding for that locale, which we don't test.  It should be something
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
        plausible.  Also note that this test presupposed you actually have locales
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
        with these names installed on your system.)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
    Bug #4154559, 4778440:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
        Set the locale to Norwegian (Bokmal) and Norwegian (Nynorsk) using the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
        Regional Settings control panel on Windows.  For each setting, run this program.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
        You should see no_NO and no_NO_NY, respectively.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
    Bug #4182108:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
        Test this bug the same way you test bug #4118731.  Set the locale to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
        each of the specified locale IDs (e.g., "setenv LC_ALL japanese"), and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
        then run PrintDefaultLocale.  You should get the following results:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
            Solaris ID          Java ID     Encoding
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
            ==========          =======     ========
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
            cz                  cs_CZ       --
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
            su                  fi_FI       --
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
            fr.ISO8859-15       fr_FR       ISO8859-15
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
            fr.ISO8859-15@euro  fr_FR       ISO8859-15
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
        Where "--" is marked for "encoding," the result isn't important-- it's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
        the default encoding for that locale, which we don't test.  It should be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
        something plausible.  Also note that this test presupposed you actually
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
        have locales with these names installed on your system.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
        As of this writing, there is a bug in Solaris or in the 8859-15/euro
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
        patch for 2.6 (Solaris patch 106842-01) which causes nl_langinfo() to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
        return the wrong value for 8859-15 locales.  As a result, the encoding
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
        returned by this test is currency ISO8859-1 for 8859-15 locales.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
    Bug #4778440, 5005601, 5074060, 5107154:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
        Run the "deflocale" tool found in "data" directory (deflocale.sh on Unix,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
        deflocale.exe on Windows), and check the following:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
            4778440: Check that iw_IL is the default locale if the OS's locale is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
            Hebrew,  and in_ID for Indonesian.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
            5005601: For Norwegian locales, no_NO is selected for Bokmal, and no_NO_NY
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
            is selected for Nynorsk.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
            5074060, 5107154: On Windows XP ServicePack 2, check the default locales for the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
            following Windows locales.  Compare with the golden data (deflocale.win):
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
                Bengali - India
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
                Croatian - Bosnia and Herzegovina
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
                Bosnian - Bosnia and Herzegovina
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
                Serbian (Latin) - Bosnia and Herzegovina
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
                Serbian (Cyrillic) - Bosnia and Herzegovina
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
                Welsh - United Kingdom
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
                Maori - New Zealand
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
                Malayalam - India
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
                Maltese - Malta
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
                Quechua - Bolivia
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
                Quechua - Ecuador
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
                Quechua - Peru
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
                Setswana (Tswana) - South Africa
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
                isiXhosa (Xhosa) - South Africa
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
                isiZulu ( Zulu) - South Africa
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
                Sesotho sa Leboa (Northern Sotho) - South Africa
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
                Sami, Northern - Norway
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
                Sami, Northern - Sweden
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
                Sami, Northern - Finland
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
                Sami, Lule - Norway
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
                Sami, Lule - Sweden
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
                Sami, Southern - Norway
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
                Sami, Southern - Sweden
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
                Sami, Skolt - Finland
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
                Sami, Inari - Finland
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
    Bug # 6409997:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
        Run the "deflocale.exe" tool found in "data" directory on Windows Vista.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
        It contains the following new locales:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
                Tajik (Cyrillic) (Tajikistan) - 1251
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
                Upper Sorbian (Germany) - 1252
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
                Turkmen (Turkmenistan) - 1250
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
                Oriya (India) - 0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
                Assamese (India) - 0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
                Tibetan (People's Republic of China) - 0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
                Khmer (Cambodia) - 0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
                Lao (Lao P.D.R.) - 0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
                Sinhala (Sri Lanka) - 0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
                Inuktitut (Canada) - 0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
                Amharic (Ethiopia) - 0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
                Hausa (Latin) (Nigeria) - 1252
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
                Yoruba (Nigeria) - 1252
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
                Bashkir (Russia) - 1251
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
                Greenlandic (Greenland) - 1252
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
                Igbo (Nigeria) - 1252
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
                Yi (People's Republic of China) - 0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
                Breton (France) - 1252
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
                Uighur (People's Republic of China) - 1256
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
                Occitan (France) - 1252
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
                Corsican (France) - 1252
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
                Alsatian (France) - 1252
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
                Yakut (Russia) - 1251
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
                K'iche (Guatemala) - 1252
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
                Kinyarwanda (Rwanda) - 1252
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
                Wolof (Senegal) - 1252
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
                Dari (Afghanistan) - 1256
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
                Lower Sorbian (Germany) - 1252
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
                Bengali (Bangladesh) - 0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
                Mongolian (Traditional Mongolian) (People's Republic of China) - 0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
                Tamazight (Latin) (Algeria) - 1252
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
                English (India) - 1252
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
                English (Malaysia) - 1252
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
                English (Singapore) - 1252
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
                Spanish (United States) - 1252
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
*/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
import java.nio.charset.Charset;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
import java.util.Locale;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
public class PrintDefaultLocale {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
    public static void main(String[] args) {
6489
9e7015635425 4700857: RFE: separating user locale and user interface locale
naoto
parents: 5506
diff changeset
   234
        System.out.printf("default locale: ID: %s, Name: %s\n",
9e7015635425 4700857: RFE: separating user locale and user interface locale
naoto
parents: 5506
diff changeset
   235
            Locale.getDefault().toString(),
9e7015635425 4700857: RFE: separating user locale and user interface locale
naoto
parents: 5506
diff changeset
   236
            Locale.getDefault().getDisplayName(Locale.US));
9e7015635425 4700857: RFE: separating user locale and user interface locale
naoto
parents: 5506
diff changeset
   237
        System.out.printf("display locale: ID: %s, Name: %s\n",
9e7015635425 4700857: RFE: separating user locale and user interface locale
naoto
parents: 5506
diff changeset
   238
            Locale.getDefault(Locale.Category.DISPLAY).toString(),
9e7015635425 4700857: RFE: separating user locale and user interface locale
naoto
parents: 5506
diff changeset
   239
            Locale.getDefault(Locale.Category.DISPLAY).getDisplayName(Locale.US));
9e7015635425 4700857: RFE: separating user locale and user interface locale
naoto
parents: 5506
diff changeset
   240
        System.out.printf("format locale: ID: %s, Name: %s\n",
9e7015635425 4700857: RFE: separating user locale and user interface locale
naoto
parents: 5506
diff changeset
   241
            Locale.getDefault(Locale.Category.FORMAT).toString(),
9e7015635425 4700857: RFE: separating user locale and user interface locale
naoto
parents: 5506
diff changeset
   242
            Locale.getDefault(Locale.Category.FORMAT).getDisplayName(Locale.US));
9e7015635425 4700857: RFE: separating user locale and user interface locale
naoto
parents: 5506
diff changeset
   243
        System.out.printf("default charset: %s\n", Charset.defaultCharset());
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
}