public final class UTF32 extends Object
UTF32 related utilities.
This work was originally authored by Glenn Adams (gadams@apache.org).
Modifier and Type | Method and Description |
---|---|
static String |
fromUTF32(Integer[] sa)
Convert a Unicode scalar array (UTF-32) a Java string (UTF-16).
|
static Integer[] |
toUTF32(String s,
int substitution,
boolean errorOnSubstitution)
Convert Java string (UTF-16) to a Unicode scalar array (UTF-32).
|
public static Integer[] toUTF32(String s, int substitution, boolean errorOnSubstitution) throws IllegalArgumentException
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 attemptedIllegalArgumentException
- if substitution required and errorOnSubstitution
is not falsepublic static String fromUTF32(Integer[] sa) throws IllegalArgumentException
sa
- input scalar arrayIllegalArgumentException
- if an input scalar value is illegal,
e.g., a surrogate or out of rangeCopyright © 2025 Apache Software Foundation. All rights reserved.