@Test public void testReplaceAsciiToLowercase() { assertEquals("cnnic.cn", DomainUtil.replaceAsciiToLowercase("Cnnic.cn")); assertEquals("cnnic.cn", DomainUtil.replaceAsciiToLowercase("CNNIC.cn")); assertEquals("cnnic.cn", DomainUtil.replaceAsciiToLowercase("CNNIC.CN")); assertEquals("中国.cn", DomainUtil.replaceAsciiToLowercase("中国.CN")); }
public static String replaceAsciiToLowercase(String str) { if (StringUtils.isBlank(str)) { return str; } StringBuffer asciiLowerCasedSb = new StringBuffer(); for (int i = 0; i < str.length(); i++) { int c = str.charAt(i); char charVal = str.charAt(i); if (c <= MAX_ASCII_CODE) { asciiLowerCasedSb.append(StringUtils.lowerCase(String .valueOf(charVal))); } else { asciiLowerCasedSb.append(String.valueOf(charVal)); } } return asciiLowerCasedSb.toString(); }
DomainUtil { public static String replaceAsciiToLowercase(String str) { if (StringUtils.isBlank(str)) { return str; } StringBuffer asciiLowerCasedSb = new StringBuffer(); for (int i = 0; i < str.length(); i++) { int c = str.charAt(i); char charVal = str.charAt(i); if (c <= MAX_ASCII_CODE) { asciiLowerCasedSb.append(StringUtils.lowerCase(String .valueOf(charVal))); } else { asciiLowerCasedSb.append(String.valueOf(charVal)); } } return asciiLowerCasedSb.toString(); } }
DomainUtil { public static String replaceAsciiToLowercase(String str) { if (StringUtils.isBlank(str)) { return str; } StringBuffer asciiLowerCasedSb = new StringBuffer(); for (int i = 0; i < str.length(); i++) { int c = str.charAt(i); char charVal = str.charAt(i); if (c <= MAX_ASCII_CODE) { asciiLowerCasedSb.append(StringUtils.lowerCase(String .valueOf(charVal))); } else { asciiLowerCasedSb.append(String.valueOf(charVal)); } } return asciiLowerCasedSb.toString(); } private  DomainUtil(); }
DomainUtil { public static String replaceAsciiToLowercase(String str) { if (StringUtils.isBlank(str)) { return str; } StringBuffer asciiLowerCasedSb = new StringBuffer(); for (int i = 0; i < str.length(); i++) { int c = str.charAt(i); char charVal = str.charAt(i); if (c <= MAX_ASCII_CODE) { asciiLowerCasedSb.append(StringUtils.lowerCase(String .valueOf(charVal))); } else { asciiLowerCasedSb.append(String.valueOf(charVal)); } } return asciiLowerCasedSb.toString(); } private  DomainUtil(); static boolean isArpaTldAndLabelIsValid(String domainName); static boolean validateDomainNameIsValidIdna(String domainName,
            boolean forSearch); static boolean validateSearchStringIsValidIdna(String searchString); static String deleteLastPoint(String paramStr); static String getLowerCaseByLabel(String str); static String safeGeneDomainPunyName(String domainName); static String geneDomainPunyName(String domainName); static String urlDecodeAndReplaceAsciiToLowercase(String str); static String replaceAsciiToLowercase(String str); static String urlDecode(String str); static String iso8859Decode(String str); static boolean isLdh(String domain); static boolean validateSearchLdnName(String searchString); }
DomainUtil { public static String replaceAsciiToLowercase(String str) { if (StringUtils.isBlank(str)) { return str; } StringBuffer asciiLowerCasedSb = new StringBuffer(); for (int i = 0; i < str.length(); i++) { int c = str.charAt(i); char charVal = str.charAt(i); if (c <= MAX_ASCII_CODE) { asciiLowerCasedSb.append(StringUtils.lowerCase(String .valueOf(charVal))); } else { asciiLowerCasedSb.append(String.valueOf(charVal)); } } return asciiLowerCasedSb.toString(); } private  DomainUtil(); static boolean isArpaTldAndLabelIsValid(String domainName); static boolean validateDomainNameIsValidIdna(String domainName,
            boolean forSearch); static boolean validateSearchStringIsValidIdna(String searchString); static String deleteLastPoint(String paramStr); static String getLowerCaseByLabel(String str); static String safeGeneDomainPunyName(String domainName); static String geneDomainPunyName(String domainName); static String urlDecodeAndReplaceAsciiToLowercase(String str); static String replaceAsciiToLowercase(String str); static String urlDecode(String str); static String iso8859Decode(String str); static boolean isLdh(String domain); static boolean validateSearchLdnName(String searchString); static final String XN_PREFIX; static final String ACE_PREFIX; static final int MAX_DOMAIN_LENGTH_WITHOUT_LAST_DOT; static final int MIN_DOMAIN_LENGTH_WITHOUT_LAST_DOT; static final String ARPA_SUFFIX; static final String IPV4_ARPA_SUFFIX; static final String IPV6_ARPA_SUFFIX; static final int MAX_ASCII_CODE; static final String BLANK_IN_DOMAIN; static final java.lang.String DISALLOWED_DELIMITERS; }