code: private static String normalize(String name)
    {
      CharBuffer cb = new CharBuffer();
  
      int len = name.length();
      for (int i = 0; i < len; i++) {
        char ch = name.charAt(i);
  
        if (Character.isLowerCase(ch))
          cb.append(Character.toUpperCase(ch));
        else if (ch == '_')
          cb.append('-');
        else
          cb.append(ch);
      }
  
      return cb.close();
    }
docs: Normalize the user's encoding name to avoid case issues.