public final class NLS
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
ccsidToEncoding(int ccsid)
Returns a best-guess Java encoding given a CCSID.
|
static int |
encodingToCCSID(java.lang.String encoding)
Returns a best-guess CCSID given a Java encoding.
|
static java.lang.String |
getCountryDescription(AS400 system,
java.lang.String countryID)
Retrieves the descriptive text for the specified country or region identifier.
|
static java.lang.String |
getLanguageDescription(AS400 system,
java.lang.String languageID)
Retrieves the descriptive text for the specified language identifier.
|
static boolean |
isForceJavaConversion()
Indicates whether or not any text conversion performed by the Toolbox uses the
converter tables that are part of the Toolbox, or the converter tables that are
part of the Java Runtime Environment.
|
static int |
localeToCCSID(java.util.Locale locale)
Returns a best-guess CCSID given a Java Locale object.
|
static int |
localeToCCSID(java.lang.String localeString)
Returns a best-guess CCSID given a Java locale string.
|
static java.lang.String |
localeToNLV(java.util.Locale locale)
Returns a best-guess National Language Version (NLV) string given a Java Locale object.
|
static java.lang.String |
localeToNLV(java.lang.String localeString)
Returns a best-guess National Language Version (NLV) string given a Java locale string.
|
static void |
setForceJavaConversion(boolean forceJavaTables)
Sets whether or not any text conversion performed by the Toolbox uses the
converter tables that are part of the Toolbox, or the converter tables that are
part of the Java Runtime Environment.
|
public static java.lang.String ccsidToEncoding(int ccsid)
ccsid
- The coded character set identifier (CCSID), e.g. 37.encodingToCCSID(java.lang.String)
,
localeToCCSID(java.lang.String)
public static int encodingToCCSID(java.lang.String encoding)
encoding
- The encoding, e.g. "Cp037".ccsidToEncoding(int)
,
localeToCCSID(java.lang.String)
public static int localeToCCSID(java.lang.String localeString)
localeString
- The locale string, e.g. "de_CH".public static int localeToCCSID(java.util.Locale locale)
Locale.ENGLISH
)
will return the single-byte EBCDIC CCSID of 37.locale
- The Locale object.public static java.lang.String localeToNLV(java.lang.String localeString)
localeString
- The locale string, e.g. "de_CH".public static java.lang.String localeToNLV(java.util.Locale locale)
locale
- The Locale object.public static java.lang.String getCountryDescription(AS400 system, java.lang.String countryID) throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
system
- The system.countryID
- The country or region identifier.AS400Exception
- If an error occurs.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the object does not exist.getLanguageDescription(com.ibm.as400.access.AS400, java.lang.String)
public static java.lang.String getLanguageDescription(AS400 system, java.lang.String languageID) throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
system
- The system.languageID
- The language identifier.AS400Exception
- If an error occurs.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the object does not exist.getCountryDescription(com.ibm.as400.access.AS400, java.lang.String)
public static boolean isForceJavaConversion()
setForceJavaConversion(boolean)
public static void setForceJavaConversion(boolean forceJavaTables)
The usefulness of this method is arbitrary. Typically, applications only need to force Java conversion if they are seeing inconsistent character conversion between an older release of the Toolbox and a newer one. Some problem characters include EBCDIC line feeds and a few characters in Katakana, such as the middle dot or bullet.
forceJavaTables
- Specify true if the Java Runtime Environement converter tables are used;
false if the Toolbox converter tables are used. The default is false.isForceJavaConversion()