Class UTF32
java.lang.Object
org.apache.fop.complexscripts.util.UTF32
UTF32 related utilities.
This work was originally authored by Glenn Adams (gadams@apache.org).
-
Method Summary
-
Method Details
-
toUTF32
public static Integer[] toUTF32(String s, int substitution, boolean errorOnSubstitution) throws IllegalArgumentException Convert Java string (UTF-16) to a Unicode scalar array (UTF-32). Note that if there are any non-BMP encoded characters present in the input, then the number of entries in the output array will be less than the number of elements in the input string. Any- Parameters:
s
- input stringsubstitution
- value to substitute for ill-formed surrogateerrorOnSubstitution
- throw runtime exception (IllegalArgumentException) in case this argument is true and a substitution would be attempted- Returns:
- output scalar array
- Throws:
IllegalArgumentException
- if substitution required and errorOnSubstitution is not false
-
fromUTF32
Convert a Unicode scalar array (UTF-32) a Java string (UTF-16).- Parameters:
sa
- input scalar array- Returns:
- output (UTF-16) string
- Throws:
IllegalArgumentException
- if an input scalar value is illegal, e.g., a surrogate or out of range
-