code:     public static Charset getCharset(String enc)
              throws UnsupportedEncodingException {
  
          // Encoding names should all be ASCII
          String lowerCaseEnc = enc.toLowerCase(Locale.US);
          
          Charset charset = (Charset) encodingToCharsetCache.get(lowerCaseEnc);
  
          if (charset == null) {
              // Pre-population of the cache means this must be invalid
              throw new UnsupportedEncodingException(enc);
          }
          return charset;
      }
  
  