Oracle® Globalization Development Kit Java API Reference
10g Release 1(10.1)

B10971-01

oracle.i18n.util
Class LocaleMapper

java.lang.Object
  |
  +--oracle.i18n.util.LocaleMapper

public class LocaleMapper
extends Object

LocaleMapper does mappings between Oracle locale elements and equivalent locale elements in other vendors and standards. This class contains the same mapping data as the C NLSRTL library and package oracle.gss.util.

The locale mappings are available for Oracle and Java locales. The character set encoding mappings are available for Oracle, Java, and IANA.

Since:
10.1.0.2

Field Summary
static int EMAIL_UNIX
          Constant value to represent Unix for email
static int EMAIL_WINDOWS
          Constant value to represent Windows for email
static int IANA
          Constant value to represent IANA
static int JAVA
          Constant value to represent JAVA
static int ORACLE
          Constant value to represent Oracle
static int UNIX
          Constant value to represent Unix for general
static int WINDOWS
          Constant value to represent Windows for general

 

Method Summary
static String[] getAvailableIANACharacterSets()
          Returns an array of all IANA character set names that have corresponding Oracle Character sets
static String[] getAvailableOraCharacterSets()
          Returns an array of all Oracle character set names that have corresponding IANA character sets
static String getIANACharacterSet(int from, String charset)
          Returns the IANA character set that is equivalent to the Oracle or Java Character set passed in
static String[] getIANACharSetFromLocale(int context, Locale locale)
          Returns commonly used IANA Character set based on the given context and locale.
static String[] getIANACharSetFromOraLang(int context, String oraLanguage)
          Returns commonly used IANA Character set based on the given context and Oracle language.
static String getJavaCharacterSet(int from, String charset)
          Returns the Java character set that is equivalent to the Oracle or IANA Character set passed in
static String getJavaLangFromOraLang(String lang)
          Returns ISO 639 two letter code given Oracle language name Due to the same reason discussed in getOraLangFromJavaLang(java.lang.String), if either Simplified Chinese and Traditional Chinese is specified, this method always returns zh.
static Locale getJavaLocale(String oraLanguage, String oraTerritory)
          Returns a Java Locale instance that is equivalent to the oracle locale specified by the passed in Oracle language and territory
static String getJavaTerrFromOraTerr(String terr)
          Returns ISO 3166 two letter code given Oracle territory name
static String getOraCharacterSet(int from, String charset)
          Returns the Oracle character set that is equivalent to the Java Character set passed in
static String[] getOraCharSetFromOraLang(int context, String oraLanguage)
          Returns commonly used Oracle Character set based on the given context and Oracle language.
static String getOraLangFromJavaLang(String lang)
          Returns Oracle language name given ISO 639 two letter code Due to the limitation of ISO 639 two letter code, Simplified Chinese and Tradtional Chinese cannot be distinguished.
static String getOraLanguage(Locale locale)
          Returns the Oracle language name based on given Java Locale
static String getOraLanguageFromShortName(String oraShortName)
          Returns the Oracle language name from the Oracle short language name
static String getOraTerrFromJavaTerr(String terr)
          Returns Oracle territory name given ISO 3166 two letter code
static String getOraTerritory(Locale locale)
          Returns the Oracle territory name given a Java Locale

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

ORACLE

public static final int ORACLE
Constant value to represent Oracle
See Also:
Constant Field Values

IANA

public static final int IANA
Constant value to represent IANA
See Also:
Constant Field Values

JAVA

public static final int JAVA
Constant value to represent JAVA
See Also:
Constant Field Values

EMAIL_WINDOWS

public static final int EMAIL_WINDOWS
Constant value to represent Windows for email
See Also:
Constant Field Values

EMAIL_UNIX

public static final int EMAIL_UNIX
Constant value to represent Unix for email
See Also:
Constant Field Values

WINDOWS

public static final int WINDOWS
Constant value to represent Windows for general
See Also:
Constant Field Values

UNIX

public static final int UNIX
Constant value to represent Unix for general
See Also:
Constant Field Values
Method Detail

getAvailableIANACharacterSets

public static String[] getAvailableIANACharacterSets()
Returns an array of all IANA character set names that have corresponding Oracle Character sets
Returns:
an array of String containing the list of IANA names.

getAvailableOraCharacterSets

public static String[] getAvailableOraCharacterSets()
Returns an array of all Oracle character set names that have corresponding IANA character sets
Returns:
an array of String containing the list of Oracle names.

getIANACharacterSet

public static String getIANACharacterSet(int from,
String charset)
Returns the IANA character set that is equivalent to the Oracle or Java Character set passed in
Parameters:
from - can be ORACLE or JAVA
charset - character set name with which we want to find an equivalent IANA character set
Returns:
IANA character set name, null if not found

getJavaCharacterSet

public static String getJavaCharacterSet(int from,
String charset)
Returns the Java character set that is equivalent to the Oracle or IANA Character set passed in
Parameters:
from - can be ORACLE or IANA
charset - character set name with which we want to find an equivalent Java character set
Returns:
Java character set name, null if not found

getOraCharacterSet

public static String getOraCharacterSet(int from,
String charset)
Returns the Oracle character set that is equivalent to the Java Character set passed in
Parameters:
from - can be IANA or JAVA
charset - character set name with which we want to find an equivalent Oracle character set
Returns:
Oracle character set name, null if not found

getJavaLocale

public static Locale getJavaLocale(String oraLanguage,
String oraTerritory)
Returns a Java Locale instance that is equivalent to the oracle locale specified by the passed in Oracle language and territory
Parameters:
oraLanguage - Oracle language
oraTerritory - Oracle territory
Returns:
Java Locale instance, defaults to American_America

getOraLanguageFromShortName

public static String getOraLanguageFromShortName(String oraShortName)
Returns the Oracle language name from the Oracle short language name
Parameters:
oraShortName - Oracle short language name
Returns:
Oracle language name

getOraLanguage

public static String getOraLanguage(Locale locale)
Returns the Oracle language name based on given Java Locale
Parameters:
locale - Java locale instance
Returns:
Oracle language name associated with the given locale, or null no corresponding Oracle language is found.

getOraTerritory

public static String getOraTerritory(Locale locale)
Returns the Oracle territory name given a Java Locale
Parameters:
locale - Java locale instance
Returns:
Oracle territory name associated with the given locale

getIANACharSetFromLocale

public static String[] getIANACharSetFromLocale(int context,
Locale locale)
Returns commonly used IANA Character set based on the given context and locale. For example, an email application may need to use a different character set than a web application
Parameters:
context - can be EMAIL_WINDOWS, EMAIL_UNIX, WINDOWS, UNIX
locale - Java Locale
Returns:
Oracle territory name associated with the given locale

getIANACharSetFromOraLang

public static String[] getIANACharSetFromOraLang(int context,
String oraLanguage)
Returns commonly used IANA Character set based on the given context and Oracle language. For example, an email application may need to use a different character set than a web application
Parameters:
context - can be EMAIL_WINDOWS, EMAIL_UNIX, WINDOWS, UNIX
oraLanguage - Oracle language
Returns:
Oracle territory name associated with the given locale

getOraCharSetFromOraLang

public static String[] getOraCharSetFromOraLang(int context,
String oraLanguage)
Returns commonly used Oracle Character set based on the given context and Oracle language. For example, an email application may need to use a different character set than a web application
Parameters:
context - can be EMAIL_WINDOWS, EMAIL_UNIX, WINDOWS, UNIX
oraLanguage - Oracle language
Returns:
Oracle territory name associated with the given locale

getOraLangFromJavaLang

public static String getOraLangFromJavaLang(String lang)
Returns Oracle language name given ISO 639 two letter code

Due to the limitation of ISO 639 two letter code, Simplified Chinese and Tradtional Chinese cannot be distinguished. In fact, if zh is given, this method returns Simplified Chinese only; it never returns Traditional Chinese.
Use getOraLanguage(java.util.Locale) if those two Chinese languages need to be distinguished.

Parameters:
lang - ISO 639 two letter code
Returns:
Oracle language name

getJavaLangFromOraLang

public static String getJavaLangFromOraLang(String lang)
Returns ISO 639 two letter code given Oracle language name

Due to the same reason discussed in getOraLangFromJavaLang(java.lang.String), if either Simplified Chinese and Traditional Chinese is specified, this method always returns zh. It means it loses the information.
Use getJavaLocale(java.lang.String, java.lang.String) instead.

Parameters:
lang - Oracle language name
Returns:
ISO 639 two letter code

getOraTerrFromJavaTerr

public static String getOraTerrFromJavaTerr(String terr)
Returns Oracle territory name given ISO 3166 two letter code
Parameters:
terr - ISO 3166 two letter code
Returns:
Oracle territory name

getJavaTerrFromOraTerr

public static String getJavaTerrFromOraTerr(String terr)
Returns ISO 3166 two letter code given Oracle territory name
Parameters:
terr - Oracle territory name
Returns:
ISO 3166 two letter code

Oracle® Globalization Development Kit Java API Reference
10g Release 1(10.1)

B10971-01

Copyright © 2003 Oracle Corporation. All Rights Reserved.