Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #7301

Re: Locale.getDefault bug in JDK 1.7

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!69.16.185.16.MISMATCH!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
From Lew <lewbloch@gmail.com>
Newsgroups comp.lang.java.programmer
Subject Re: Locale.getDefault bug in JDK 1.7
Date Mon, 22 Aug 2011 12:40:38 -0700 (PDT)
Organization http://groups.google.com
Lines 62
Message-ID <ec5ebc9b-3fdb-40fc-ae57-bcc57713ad4c@glegroupsg2000goo.googlegroups.com> (permalink)
References <k4u357dqe5lejh08eiadvd2ad2kji1ivho@4ax.com> <j2u503$ai1$3@dont-email.me> <dfb5840e-45d2-4ac6-9dfd-db7c4e4b6cf9@glegroupsg2000goo.googlegroups.com>
Reply-To comp.lang.java.programmer@googlegroups.com
NNTP-Posting-Host 2620:0:1000:437c:224:d7ff:fe69:5838
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
X-Trace posting.google.com 1314042157 24725 127.0.0.1 (22 Aug 2011 19:42:37 GMT)
X-Complaints-To groups-abuse@google.com
NNTP-Posting-Date Mon, 22 Aug 2011 19:42:37 +0000 (UTC)
In-Reply-To <dfb5840e-45d2-4ac6-9dfd-db7c4e4b6cf9@glegroupsg2000goo.googlegroups.com>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=2620:0:1000:437c:224:d7ff:fe69:5838; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T
User-Agent G2/1.0
X-Google-Web-Client true
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:7301

Show key headers only | View raw


<sscce source="tryout/Localizer.java">
package tryout;

import java.util.Locale;

/**
 * Try out Locale tricks.
 * Invocations to try:
 *  java tryout.Localizer
 *  java -Duser.language=fr tryout.Localizer
 *  java -Duser.language=fr -Duser.country=CA tryout.Localizer
 */
public class Localizer {
  /** main method.
   * @param args String [] arguments.
   */
  public static void main(String [] args) {
    System.out.println("");
    System.out.println("user.language = " + System.getProperty("user.language"));
    System.out.println(" user.country = " + System.getProperty("user.country"));
    System.out.println(" user.variant = " + System.getProperty("user.variant"));

    System.out.println("");
    System.out.println("default");
    display(Locale.getDefault());
    
    System.out.println("");
    System.out.println("Set default to CANADA");
    Locale.setDefault(Locale.CANADA);
    display(Locale.getDefault());
    
    System.out.println("");
    System.out.println("Set default to FRANCE");
    Locale.setDefault(Locale.FRANCE);
    display(Locale.getDefault());
    
    System.out.println("");
    System.out.println("Set default to CANADA_FRENCH");
    Locale.setDefault(Locale.CANADA_FRENCH);
    display(Locale.getDefault());
    
    System.out.println("");
    System.out.println("Display CANADA");
    display(Locale.CANADA);
    
    System.out.println("");
    System.out.println("Display FRANCE");
    display(Locale.FRANCE);
    
    System.out.println("");
    System.out.println("Display CANADA_FRENCH");
    display(Locale.CANADA_FRENCH);
    
  }

  private static void display(Locale locale) {
    System.out.println("Locale = " + locale.toString() 
        + " language = \"" + locale.getLanguage() + "\" country = \"" 
        + locale.getCountry() + "\" variant = \"" + locale.getVariant() + "\"");
  }
}
</sscce>

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Locale.getDefault bug in JDK 1.7 Roedy Green <see_website@mindprod.com.invalid> - 2011-08-21 23:56 -0700
  Re: Why does Eclipse find error in simple "public static void main( String[] args) { } instruction? Roedy Green <see_website@mindprod.com.invalid> - 2011-08-21 23:58 -0700
    Re: Why does Eclipse find error in simple "public static void main( String[] args) { } instruction? Patricia Shanahan <pats@acm.org> - 2011-08-22 08:37 -0700
      Re: Why does Eclipse find error in simple "public static void main( String[] args) { } instruction? Lew <lewbloch@gmail.com> - 2011-08-22 08:56 -0700
        Re: Why does Eclipse find error in simple "public static void main( String[] args) { } instruction? Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-08-22 09:15 -0700
          Re: Why does Eclipse find error in simple "public static void main( String[] args) { } instruction? Roedy Green <see_website@mindprod.com.invalid> - 2011-08-22 10:02 -0700
            Re: Why does Eclipse find error in simple "public static void main( String[] args) { } instruction? markspace <-@.> - 2011-08-22 10:50 -0700
            Re: Why does Eclipse find error in simple "public static void main( String[] args) { } instruction? Arne Vajhøj <arne@vajhoej.dk> - 2011-08-23 19:03 -0400
        Re: Why does Eclipse find error in simple "public static void main( String[] args) { } instruction? markspace <-@.> - 2011-08-22 10:48 -0700
  Re: Locale.getDefault bug in JDK 1.7 Roedy Green <see_website@mindprod.com.invalid> - 2011-08-22 07:34 -0700
  Re: Locale.getDefault bug in JDK 1.7 markspace <-@.> - 2011-08-22 10:51 -0700
    Re: Locale.getDefault bug in JDK 1.7 Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-08-22 18:18 +0000
    Re: Locale.getDefault bug in JDK 1.7 Lew <lewbloch@gmail.com> - 2011-08-22 11:22 -0700
      Re: Locale.getDefault bug in JDK 1.7 Lew <lewbloch@gmail.com> - 2011-08-22 12:40 -0700
      Re: Locale.getDefault bug in JDK 1.7 Roedy Green <see_website@mindprod.com.invalid> - 2011-08-23 09:04 -0700
        Re: Locale.getDefault bug in JDK 1.7 Roedy Green <see_website@mindprod.com.invalid> - 2011-08-23 09:10 -0700
    Re: Locale.getDefault bug in JDK 1.7 Roedy Green <see_website@mindprod.com.invalid> - 2011-08-23 08:08 -0700
      Re: Locale.getDefault bug in JDK 1.7 Silvio <silvio@moc.com> - 2011-08-23 17:22 +0200
        Re: Locale.getDefault bug in JDK 1.7 Lew <lewbloch@gmail.com> - 2011-08-23 09:02 -0700
          Re: Locale.getDefault bug in JDK 1.7 Silvio <silvio@moc.com> - 2011-08-23 22:57 +0200
            Re: Locale.getDefault bug in JDK 1.7 Lew <lewbloch@gmail.com> - 2011-08-23 18:03 -0700
              Re: Locale.getDefault bug in JDK 1.7 Silvio <silvio@moc.com> - 2011-08-24 09:09 +0200
                Re: Locale.getDefault bug in JDK 1.7 Roedy Green <see_website@mindprod.com.invalid> - 2011-08-25 07:00 -0700
                Re: Locale.getDefault bug in JDK 1.7 Lew <lewbloch@gmail.com> - 2011-08-25 09:56 -0700
                Re: Locale.getDefault bug in JDK 1.7 supercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com> - 2011-08-25 15:50 -0400
                Re: Locale.getDefault bug in JDK 1.7 Roedy Green <see_website@mindprod.com.invalid> - 2011-08-25 12:55 -0700
                Re: Locale.getDefault bug in JDK 1.7 Silvio <silvio@moc.com> - 2011-08-27 00:48 +0200
        Re: Locale.getDefault bug in JDK 1.7 Roedy Green <see_website@mindprod.com.invalid> - 2011-08-25 06:54 -0700
  Re: Locale.getDefault bug in JDK 1.7 Roedy Green <see_website@mindprod.com.invalid> - 2011-08-23 09:43 -0700
    Re: Locale.getDefault bug in JDK 1.7 Roedy Green <see_website@mindprod.com.invalid> - 2011-09-02 08:24 -0700
      Re: Locale.getDefault bug in JDK 1.7 Jeff Higgins <jeff@invalid.invalid> - 2011-09-02 11:34 -0400

csiph-web