Recently I rebuilt some forms so they would accept International Domains like
http://例子.测试
I would then store these as punycode. Before this though we had validation code running to check whether the domain was valid using Coldfusions isValid()
method:
if(not isValid("url", sURL)){
return false;
}
With punycode we have an issue of the isValid()
function failing when the domain is like:
http://例子.测
or when it is converted to it's punycode using CreateObject( "java", "java.net.IDN" ).toASCII(sURL);
and in certain cases comes out like:
xn--http://133ab--xn328sdf
(made up example but in certain cases there will be characters before the http:// part)
is there currently a way of using either a Java library or Coldfusion library or regex to validate IDNs and "normal" domains?