code: public static Locale getLocaleFromName(String name) {
          String language = "";
          String country = "";
          String variant = "";
  
          int i1 = name.indexOf('_');
          if (i1 < 0) {
              language = name;
          } else {
              language = name.substring(0, i1);
              ++i1;
              int i2 = name.indexOf('_', i1);
              if (i2 < 0) {
                  country = name.substring(i1);
              } else {
                  country = name.substring(i1, i2);
                  variant = name.substring(i2+1);
              }
          }
  
          return new Locale(language, country, variant);
      }
docs: A helper function to convert a string of the form
  aa_BB_CC to a locale object.  Why isn't this in Locale?