3 Replies Latest reply: Feb 25, 2009 12:40 PM by thomas_behr RSS

    (new Locale("us")).getDisplayCountry() returning empty String


      I am attempting to resolve an ISO 3166 country code (like 'us') to a country name (like 'United States') using the following code
      import java.util.Locale;
      public class CountryNames {
              public static void main(String args[]) {
                      Locale locale = new Locale("us");
                      System.out.println("getDisplayCountry is>" + locale.getDisplayCountry() + "<");
      Following is the output I get
      getDisplayCountry is><
      But I was expecting to see "United States". Is this the right approach to resolving country codes to country names? Please help.