com.vgrs.xcode.cmdline.idna
Class PunycodeCmdLine

java.lang.Object
  extended by com.vgrs.xcode.cmdline.CmdLine
      extended by com.vgrs.xcode.cmdline.idna.PunycodeCmdLine

public class PunycodeCmdLine
extends CmdLine

This tool compresses and converts Unicode data into an ASCII compatible sequence. This algorithm was designed for use with IDNA. No other ACE encoding is supported by the IETF. The IDNA RFC gives applications permission to choose whether or not to exclude ASCII characters which are not a letter, digit, or hyphen. If the –3 switch is given, these codepoints are allowed to be encoded by Punycode.

Usage: com.vgrs.xcode.cmdline.idna.PunycodeCmdLine [-3] (--encode | --decode) file=[file name]

Version:
1.0 Aug 16, 2010
Author:
nchigurupati

Field Summary
 
Fields inherited from class com.vgrs.xcode.cmdline.CmdLine
SWITCH_FILE
 
Constructor Summary
PunycodeCmdLine(java.lang.String[] args)
           
 
Method Summary
 java.lang.String getUsageOptions()
           
static void main(java.lang.String[] args)
           
static void testDecode(java.io.File input)
          Decode Punycode strings in the input file into Unicode code points
static void testDecode(java.lang.String input)
          Decode the Punycode string into Unicode code points
static void testEncode(java.io.File input)
          Encode the Unicode code points in the input file into Punycode string.
static void testEncode(java.lang.String input)
          Encode the Unicode code points in the input string into Punycode string.
 
Methods inherited from class com.vgrs.xcode.cmdline.CmdLine
getCommandName, getOptions, setCommandName, setOptions, showUsage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PunycodeCmdLine

public PunycodeCmdLine(java.lang.String[] args)
Parameters:
args - the command line arguments.
Method Detail

main

public static void main(java.lang.String[] args)

testEncode

public static void testEncode(java.io.File input)
Encode the Unicode code points in the input file into Punycode string.

Parameters:
input - file containing Unicode code points to be encoded.

testDecode

public static void testDecode(java.io.File input)
Decode Punycode strings in the input file into Unicode code points

Parameters:
input - file containing punycode strings to be decoded.

testEncode

public static void testEncode(java.lang.String input)
                       throws XcodeException
Encode the Unicode code points in the input string into Punycode string.

Parameters:
input - string containing Unicode code points to be encoded.
Throws:
XcodeException

testDecode

public static void testDecode(java.lang.String input)
                       throws XcodeException
Decode the Punycode string into Unicode code points

Parameters:
input - punycode string to be decoded.
Throws:
XcodeException

getUsageOptions

public java.lang.String getUsageOptions()
Specified by:
getUsageOptions in class CmdLine
Returns:
the usage of this command line class.


Copyright © 2000-2010 VeriSign Inc. All Rights Reserved