code: protected static String normaliseTag(String tag) {
          StringBuffer nt = new StringBuffer();
          for(char c : tag.toLowerCase(Locale.ROOT).toCharArray()) {
              if((int)c >= 0x20 && (int)c <= 0x7d &&
                      (int)c != 0x3d) {
                  nt.append(c);
              }
          }
          return nt.toString();
      }
docs: The tag name is case-insensitive and may consist of ASCII 0x20
  through 0x7D, 0x3D (’=’) excluded. ASCII 0x41 through 0x5A
  inclusive (characters A-Z) is to be considered equivalent to
  ASCII 0x61 through 0x7A inclusive (characters a-z).