IDN toASCII Example

IDN class toASCII example. This example shows you how to use toASCII method.


IDN class toASCII example. public static String toASCII(String input, int flag) Translates a string from Unicode to ASCII Compatible Encoding (ACE), as defined by the ToASCII operation of RFC 3490.

Here is the code
/*
 * @ # ToASCII.java
 * A class repersenting use to toASCII method 
 * of IDN class in java.net package
 * version 23 June 2008
 * author Rose India 
 */

import java.net.*;

public class ToASCII {

    public static void main(String args[]) {

        String s = "http://google.com";
        try {
            System.out.println(IDN.toASCII(s,0));
        catch (IllegalArgumentException iae) {
            System.out.println(iae.toString());
        }
    }
}

Output
http://google.com

Post Comment
Name:
E-mail:
Contact no :
Comments:
  Refresh Image
Verify Image:
 
 
Your Comment's
 
 
 

HOME | COPYRIGHT | CONTACT US