Class LcidLocale

java.lang.Object
org.olap4j.impl.LcidLocale

public class LcidLocale extends Object
Mapping between Locale and Locale identifier (LCID).
Author:
jhyde
  • Method Details

    • lcidToLocale

      public static Locale lcidToLocale(short lcid)
      Converts a locale identifier (LCID) as used by Windows into a Java locale.

      For example, lcidToLocale(1033) returns "en_US", because 1033 (hex 0409) is US english.

      Parameters:
      lcid - Locale identifier
      Returns:
      Locale
      Throws:
      RuntimeException - if locale id is unkown
    • localeToLcid

      public static short localeToLcid(Locale locale)
      Converts a locale name to a locale identifier (LCID).

      For example, localeToLcid(Locale.US) returns 1033, because 1033 (hex 0409) is US english.

      Parameters:
      locale - Locale
      Returns:
      Locale identifier
      Throws:
      RuntimeException - if locale has no known LCID
    • parseLocale

      public static Locale parseLocale(String localeString)
      Parses a locale string.

      The inverse operation of Locale.toString().

      Parameters:
      localeString - Locale string, e.g. "en" or "en_US"
      Returns:
      Java locale object