static CharSequence domainToAscii(String host) throws MalformedIDNException { try { return IDNP.toASCII(host, IDN.USE_STD3_ASCII_RULES|IDN.ALLOW_UNASSIGNED); } catch (Exception e) { throw new MalformedIDNException(e); } /* int u[] = new int[host.length()]; for (int i = 0; i < host.length(); i++) u[i] = host.charAt(i); try { return idna.domainToAscii(u); } catch (XcodeException e) { throw new MalformedIDNException(e); } */ }
private static CharSequence domainToAscii(String host) throws MalformedIDNException { try { return IDNP.toASCII(host, IDN.USE_STD3_ASCII_RULES|IDN.ALLOW_UNASSIGNED); // IDNP (patched IDN) throws IlleaglArgimentException } catch (IllegalArgumentException ex) { // IDNP (patched IDN) throws IlleaglArgumentException throw new MalformedIDNException(ex) ; } /* int u[] = new int[host.length()]; for (int i = 0; i < host.length(); i++) u[i] = host.charAt(i); try { return idna.domainToAscii(u); } catch (XcodeException e) { throw new MalformedIDNException(e); } */ }
private static CharSequence domainToAscii(String host) throws MalformedIDNException { try { return IDNP.toASCII(host, IDN.USE_STD3_ASCII_RULES|IDN.ALLOW_UNASSIGNED); // IDNP (patched IDN) throws IlleaglArgimentException } catch (IllegalArgumentException ex) { // IDNP (patched IDN) throws IlleaglArgumentException throw new MalformedIDNException(ex) ; } /* int u[] = new int[host.length()]; for (int i = 0; i < host.length(); i++) u[i] = host.charAt(i); try { return idna.domainToAscii(u); } catch (XcodeException e) { throw new MalformedIDNException(e); } */ }