com.ibm.icu.text
public final class IDNA extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
ALLOW_UNASSIGNED
Option to allow processing of unassigned codepoints in the input
|
static int |
DEFAULT
Option to prohibit processing of unassigned codepoints in the input and
do not check if the input conforms to STD-3 ASCII rules.
|
static int |
USE_STD3_RULES
Option to check if input conforms to STD-3 ASCII rules
|
Modifier and Type | Method and Description |
---|---|
static int |
compare(java.lang.StringBuffer s1,
java.lang.StringBuffer s2,
int options)
Compare two IDN strings for equivalence.
|
static int |
compare(java.lang.String s1,
java.lang.String s2,
int options)
Compare two IDN strings for equivalence.
|
static int |
compare(UCharacterIterator s1,
UCharacterIterator s2,
int options)
Compare two IDN strings for equivalence.
|
static java.lang.StringBuffer |
convertIDNToASCII(java.lang.StringBuffer src,
int options)
Convenience function that implements the IDNToASCII operation as defined in the IDNA RFC.
|
static java.lang.StringBuffer |
convertIDNToASCII(java.lang.String src,
int options)
Convenience function that implements the IDNToASCII operation as defined in the IDNA RFC.
|
static java.lang.StringBuffer |
convertIDNToASCII(UCharacterIterator src,
int options)
Convenience function that implements the IDNToASCII operation as defined in the IDNA RFC.
|
static java.lang.StringBuffer |
convertIDNToUnicode(java.lang.StringBuffer src,
int options)
Convenience function that implements the IDNToUnicode operation as defined in the IDNA RFC.
|
static java.lang.StringBuffer |
convertIDNToUnicode(java.lang.String src,
int options)
Convenience function that implements the IDNToUnicode operation as defined in the IDNA RFC.
|
static java.lang.StringBuffer |
convertIDNToUnicode(UCharacterIterator src,
int options)
Convenience function that implements the IDNToUnicode operation as defined in the IDNA RFC.
|
static java.lang.StringBuffer |
convertToASCII(java.lang.StringBuffer src,
int options)
This function implements the ToASCII operation as defined in the IDNA RFC.
|
static java.lang.StringBuffer |
convertToASCII(java.lang.String src,
int options)
This function implements the ToASCII operation as defined in the IDNA RFC.
|
static java.lang.StringBuffer |
convertToASCII(UCharacterIterator src,
int options)
This function implements the ToASCII operation as defined in the IDNA RFC.
|
static java.lang.StringBuffer |
convertToUnicode(java.lang.StringBuffer src,
int options)
This function implements the ToUnicode operation as defined in the IDNA RFC.
|
static java.lang.StringBuffer |
convertToUnicode(java.lang.String src,
int options)
This function implements the ToUnicode operation as defined in the IDNA RFC.
|
static java.lang.StringBuffer |
convertToUnicode(UCharacterIterator src,
int options)
Function that implements the ToUnicode operation as defined in the IDNA RFC.
|
public static final int DEFAULT
#convertToUnicode
,
Constant Field Valuespublic static final int ALLOW_UNASSIGNED
#convertToUnicode
,
Constant Field Valuespublic static final int USE_STD3_RULES
#convertToUnicode
,
Constant Field Valuespublic static java.lang.StringBuffer convertToASCII(java.lang.String src, int options) throws StringPrepParseException
src
- The input string to be processedoptions
- A bit set of options:
- IDNA.DEFAULT Use default options, i.e., do not process unassigned code points
and do not use STD3 ASCII rules
If unassigned code points are found the operation fails with
StringPrepParseException.
- IDNA.ALLOW_UNASSIGNED Unassigned values can be converted to ASCII for query operations
If this option is set, the unassigned code points are in the input
are treated as normal Unicode code points.
- IDNA.USE_STD3_RULES Use STD3 ASCII rules for host name syntax restrictions
If this option is set and the input does not satisfy STD3 rules,
the operation will fail with ParseExceptionStringPrepParseException
public static java.lang.StringBuffer convertToASCII(java.lang.StringBuffer src, int options) throws StringPrepParseException
src
- The input string as StringBuffer to be processedoptions
- A bit set of options:
- IDNA.DEFAULT Use default options, i.e., do not process unassigned code points
and do not use STD3 ASCII rules
If unassigned code points are found the operation fails with
ParseException.
- IDNA.ALLOW_UNASSIGNED Unassigned values can be converted to ASCII for query operations
If this option is set, the unassigned code points are in the input
are treated as normal Unicode code points.
- IDNA.USE_STD3_RULES Use STD3 ASCII rules for host name syntax restrictions
If this option is set and the input does not satisfy STD3 rules,
the operation will fail with ParseExceptionjava.text.ParseException
StringPrepParseException
public static java.lang.StringBuffer convertToASCII(UCharacterIterator src, int options) throws StringPrepParseException
src
- The input string as UCharacterIterator to be processedoptions
- A bit set of options:
- IDNA.DEFAULT Use default options, i.e., do not process unassigned code points
and do not use STD3 ASCII rules
If unassigned code points are found the operation fails with
ParseException.
- IDNA.ALLOW_UNASSIGNED Unassigned values can be converted to ASCII for query operations
If this option is set, the unassigned code points are in the input
are treated as normal Unicode code points.
- IDNA.USE_STD3_RULES Use STD3 ASCII rules for host name syntax restrictions
If this option is set and the input does not satisfy STD3 rules,
the operation will fail with ParseExceptionjava.text.ParseException
StringPrepParseException
public static java.lang.StringBuffer convertIDNToASCII(UCharacterIterator src, int options) throws StringPrepParseException
src
- The input string as UCharacterIterator to be processedoptions
- A bit set of options:
- IDNA.DEFAULT Use default options, i.e., do not process unassigned code points
and do not use STD3 ASCII rules
If unassigned code points are found the operation fails with
ParseException.
- IDNA.ALLOW_UNASSIGNED Unassigned values can be converted to ASCII for query operations
If this option is set, the unassigned code points are in the input
are treated as normal Unicode code points.
- IDNA.USE_STD3_RULES Use STD3 ASCII rules for host name syntax restrictions
If this option is set and the input does not satisfy STD3 rules,
the operation will fail with ParseExceptionjava.text.ParseException
StringPrepParseException
public static java.lang.StringBuffer convertIDNToASCII(java.lang.StringBuffer src, int options) throws StringPrepParseException
src
- The input string as a StringBuffer to be processedoptions
- A bit set of options:
- IDNA.DEFAULT Use default options, i.e., do not process unassigned code points
and do not use STD3 ASCII rules
If unassigned code points are found the operation fails with
ParseException.
- IDNA.ALLOW_UNASSIGNED Unassigned values can be converted to ASCII for query operations
If this option is set, the unassigned code points are in the input
are treated as normal Unicode code points.
- IDNA.USE_STD3_RULES Use STD3 ASCII rules for host name syntax restrictions
If this option is set and the input does not satisfy STD3 rules,
the operation will fail with ParseExceptionjava.text.ParseException
StringPrepParseException
public static java.lang.StringBuffer convertIDNToASCII(java.lang.String src, int options) throws StringPrepParseException
src
- The input string to be processedoptions
- A bit set of options:
- IDNA.DEFAULT Use default options, i.e., do not process unassigned code points
and do not use STD3 ASCII rules
If unassigned code points are found the operation fails with
ParseException.
- IDNA.ALLOW_UNASSIGNED Unassigned values can be converted to ASCII for query operations
If this option is set, the unassigned code points are in the input
are treated as normal Unicode code points.
- IDNA.USE_STD3_RULES Use STD3 ASCII rules for host name syntax restrictions
If this option is set and the input does not satisfy STD3 rules,
the operation will fail with ParseExceptionjava.text.ParseException
StringPrepParseException
public static java.lang.StringBuffer convertToUnicode(java.lang.String src, int options) throws StringPrepParseException
src
- The input string to be processedoptions
- A bit set of options:
- IDNA.DEFAULT Use default options, i.e., do not process unassigned code points
and do not use STD3 ASCII rules
If unassigned code points are found the operation fails with
ParseException.
- IDNA.ALLOW_UNASSIGNED Unassigned values can be converted to ASCII for query operations
If this option is set, the unassigned code points are in the input
are treated as normal Unicode code points.
- IDNA.USE_STD3_RULES Use STD3 ASCII rules for host name syntax restrictions
If this option is set and the input does not satisfy STD3 rules,
the operation will fail with ParseExceptionjava.text.ParseException
StringPrepParseException
public static java.lang.StringBuffer convertToUnicode(java.lang.StringBuffer src, int options) throws StringPrepParseException
src
- The input string as StringBuffer to be processedoptions
- A bit set of options:
- IDNA.DEFAULT Use default options, i.e., do not process unassigned code points
and do not use STD3 ASCII rules
If unassigned code points are found the operation fails with
ParseException.
- IDNA.ALLOW_UNASSIGNED Unassigned values can be converted to ASCII for query operations
If this option is set, the unassigned code points are in the input
are treated as normal Unicode code points.
- IDNA.USE_STD3_RULES Use STD3 ASCII rules for host name syntax restrictions
If this option is set and the input does not satisfy STD3 rules,
the operation will fail with ParseExceptionjava.text.ParseException
StringPrepParseException
public static java.lang.StringBuffer convertToUnicode(UCharacterIterator src, int options) throws StringPrepParseException
src
- The input string as UCharacterIterator to be processedoptions
- A bit set of options:
- IDNA.DEFAULT Use default options, i.e., do not process unassigned code points
and do not use STD3 ASCII rules
If unassigned code points are found the operation fails with
ParseException.
- IDNA.ALLOW_UNASSIGNED Unassigned values can be converted to ASCII for query operations
If this option is set, the unassigned code points are in the input
are treated as normal Unicode code points.
- IDNA.USE_STD3_RULES Use STD3 ASCII rules for host name syntax restrictions
If this option is set and the input does not satisfy STD3 rules,
the operation will fail with ParseExceptionjava.text.ParseException
StringPrepParseException
public static java.lang.StringBuffer convertIDNToUnicode(UCharacterIterator src, int options) throws StringPrepParseException
src
- The input string as UCharacterIterator to be processedoptions
- A bit set of options:
- IDNA.DEFAULT Use default options, i.e., do not process unassigned code points
and do not use STD3 ASCII rules
If unassigned code points are found the operation fails with
ParseException.
- IDNA.ALLOW_UNASSIGNED Unassigned values can be converted to ASCII for query operations
If this option is set, the unassigned code points are in the input
are treated as normal Unicode code points.
- IDNA.USE_STD3_RULES Use STD3 ASCII rules for host name syntax restrictions
If this option is set and the input does not satisfy STD3 rules,
the operation will fail with ParseExceptionjava.text.ParseException
StringPrepParseException
public static java.lang.StringBuffer convertIDNToUnicode(java.lang.StringBuffer src, int options) throws StringPrepParseException
src
- The input string as StringBuffer to be processedoptions
- A bit set of options:
- IDNA.DEFAULT Use default options, i.e., do not process unassigned code points
and do not use STD3 ASCII rules
If unassigned code points are found the operation fails with
ParseException.
- IDNA.ALLOW_UNASSIGNED Unassigned values can be converted to ASCII for query operations
If this option is set, the unassigned code points are in the input
are treated as normal Unicode code points.
- IDNA.USE_STD3_RULES Use STD3 ASCII rules for host name syntax restrictions
If this option is set and the input does not satisfy STD3 rules,
the operation will fail with ParseExceptionjava.text.ParseException
StringPrepParseException
public static java.lang.StringBuffer convertIDNToUnicode(java.lang.String src, int options) throws StringPrepParseException
src
- The input string to be processedoptions
- A bit set of options:
- IDNA.DEFAULT Use default options, i.e., do not process unassigned code points
and do not use STD3 ASCII rules
If unassigned code points are found the operation fails with
ParseException.
- IDNA.ALLOW_UNASSIGNED Unassigned values can be converted to ASCII for query operations
If this option is set, the unassigned code points are in the input
are treated as normal Unicode code points.
- IDNA.USE_STD3_RULES Use STD3 ASCII rules for host name syntax restrictions
If this option is set and the input does not satisfy STD3 rules,
the operation will fail with ParseExceptionjava.text.ParseException
StringPrepParseException
public static int compare(java.lang.StringBuffer s1, java.lang.StringBuffer s2, int options) throws StringPrepParseException
s1
- First IDN string as StringBuffers2
- Second IDN string as StringBufferoptions
- A bit set of options:
- IDNA.DEFAULT Use default options, i.e., do not process unassigned code points
and do not use STD3 ASCII rules
If unassigned code points are found the operation fails with
ParseException.
- IDNA.ALLOW_UNASSIGNED Unassigned values can be converted to ASCII for query operations
If this option is set, the unassigned code points are in the input
are treated as normal Unicode code points.
- IDNA.USE_STD3_RULES Use STD3 ASCII rules for host name syntax restrictions
If this option is set and the input does not satisfy STD3 rules,
the operation will fail with ParseExceptionjava.text.ParseException
StringPrepParseException
public static int compare(java.lang.String s1, java.lang.String s2, int options) throws StringPrepParseException
s1
- First IDN strings2
- Second IDN stringoptions
- A bit set of options:
- IDNA.DEFAULT Use default options, i.e., do not process unassigned code points
and do not use STD3 ASCII rules
If unassigned code points are found the operation fails with
ParseException.
- IDNA.ALLOW_UNASSIGNED Unassigned values can be converted to ASCII for query operations
If this option is set, the unassigned code points are in the input
are treated as normal Unicode code points.
- IDNA.USE_STD3_RULES Use STD3 ASCII rules for host name syntax restrictions
If this option is set and the input does not satisfy STD3 rules,
the operation will fail with ParseExceptionjava.text.ParseException
StringPrepParseException
public static int compare(UCharacterIterator s1, UCharacterIterator s2, int options) throws StringPrepParseException
s1
- First IDN string as UCharacterIterators2
- Second IDN string as UCharacterIteratoroptions
- A bit set of options:
- IDNA.DEFAULT Use default options, i.e., do not process unassigned code points
and do not use STD3 ASCII rules
If unassigned code points are found the operation fails with
ParseException.
- IDNA.ALLOW_UNASSIGNED Unassigned values can be converted to ASCII for query operations
If this option is set, the unassigned code points are in the input
are treated as normal Unicode code points.
- IDNA.USE_STD3_RULES Use STD3 ASCII rules for host name syntax restrictions
If this option is set and the input does not satisfy STD3 rules,
the operation will fail with ParseExceptionjava.text.ParseException
StringPrepParseException
Copyright (c) 2009 IBM Corporation and others.