code: static String normalizeHostname(String hostname) {
          if (needsNormalization(hostname)) {
              hostname = IDN.toASCII(hostname, IDN.ALLOW_UNASSIGNED);
          }
          return hostname.toLowerCase(Locale.US);
      }
docs: IDNA ASCII conversion and case normalization