static String normalizeHostnamePattern(String hostnamePattern) {
        requireNonNull(hostnamePattern, "hostnamePattern");
        if (needsNormalization(hostnamePattern)) {
            hostnamePattern = IDN.toASCII(hostnamePattern, IDN.ALLOW_UNASSIGNED);
        }

        if (!"*".equals(hostnamePattern)) {
            final String withoutWildCard = hostnamePattern.startsWith("*.") ? hostnamePattern.substring(2)
                                                                            : hostnamePattern;
            if (!HOSTNAME_WITH_NO_PORT_PATTERN.matcher(withoutWildCard).matches()) {
                throw new IllegalArgumentException("hostnamePattern: " + hostnamePattern);
            }
        }

        return Ascii.toLowerCase(hostnamePattern);
    }
IDNA ASCII conversion, case normalization and validation.
core/src/main/java/com/linecorp/armeria/server/VirtualHost.java