Skip navigation links
JNA API 5.6.0
com.sun.jna.platform.win32

Class WinNT.LocaleMacros

  • Enclosing interface:
    WinNT


    public static final class WinNT.LocaleMacros
    extends java.lang.Object

    A language ID is a 16 bit value which is the combination of a primary language ID and a secondary language ID. The bits are allocated as follows:

           +-----------------------+-------------------------+
           |     Sublanguage ID    |   Primary Language ID   |
           +-----------------------+-------------------------+
            15                   10 9                       0   bit
      

    WARNING: This pattern isn't always follows, Serbina, Bosnian & Croation for example.

    It is recommended that applications test for locale names or actual LCIDs.

    Note that the LANG, SUBLANG construction is not always consistent. The named locale APIs (eg GetLocaleInfoEx) are recommended.

    Language IDs do not exist for all locales

    A locale ID is a 32 bit value which is the combination of a language ID, a sort ID, and a reserved area. The bits are allocated as follows:

       +-------------+---------+-------------------------+
       |   Reserved  | Sort ID |      Language ID        |
       +-------------+---------+-------------------------+
        31         20 19     16 15                      0   bit
     

    WARNING: This pattern isn't always followed (es-ES_tradnl vs es-ES for example)

    It is recommended that applications test for locale names or actual LCIDs.

    • Constructor Summary

      Constructors 
      Constructor and Description
      LocaleMacros() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static int LANGIDFROMLCID(WinDef.LCID lcid)
      extract the language id from a locale id.
      static int MAKELANGID(int p, int s)
      Construct language id from a primary language id and a sublanguage id.
      static WinDef.LCID MAKELCID(int lgid, int srtid)
      construct the locale id from a language id and a sort id.
      static WinDef.LCID MAKESORTLCID(int lgid, int srtid, int ver)
      construct the locale id from a language id, sort id, and sort version.
      static int PRIMARYLANGID(int lgid)
      Extract primary language id from a language id.
      static int SORTIDFROMLCID(WinDef.LCID lcid)
      extract the sort id from a locale id.
      static int SORTVERSIONFROMLCID(WinDef.LCID lcid)
      extract the sort version from a locale id.
      static int SUBLANGID(int lgid)
      Extract sublanguage id from a language id.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LocaleMacros

        public LocaleMacros()
    • Method Detail

      • MAKELCID

        public static final WinDef.LCID MAKELCID(int lgid,
                                                 int srtid)
        construct the locale id from a language id and a sort id.
        Parameters:
        lgid - language id
        srtid - sort id
        Returns:
        locale id derived from ldig and srtid
      • MAKESORTLCID

        public static final WinDef.LCID MAKESORTLCID(int lgid,
                                                     int srtid,
                                                     int ver)
        construct the locale id from a language id, sort id, and sort version.
        Parameters:
        lgid - locale id
        srtid - sort id
        ver - sort version
        Returns:
        locale id derviced from a language id, sort id, and sort version.
      • LANGIDFROMLCID

        public static final int LANGIDFROMLCID(WinDef.LCID lcid)
        extract the language id from a locale id.
        Parameters:
        lcid - locale id
        Returns:
        extracted language id
      • SORTIDFROMLCID

        public static final int SORTIDFROMLCID(WinDef.LCID lcid)
        extract the sort id from a locale id.
        Parameters:
        lcid - locale id
        Returns:
        extracted sort id
      • SORTVERSIONFROMLCID

        public static final int SORTVERSIONFROMLCID(WinDef.LCID lcid)
        extract the sort version from a locale id.
        Parameters:
        lcid - locale id
        Returns:
        extracted sort version
      • MAKELANGID

        public static final int MAKELANGID(int p,
                                           int s)
        Construct language id from a primary language id and a sublanguage id.
        Parameters:
        p - primary language ID
        s - sublanguage ID
        Returns:
        constructed language id
      • PRIMARYLANGID

        public static final int PRIMARYLANGID(int lgid)
        Extract primary language id from a language id.
        Parameters:
        lgid - language ID
        Returns:
        extracted primary language id
      • SUBLANGID

        public static final int SUBLANGID(int lgid)
        Extract sublanguage id from a language id.
        Parameters:
        lgid - language ID
        Returns:
        extracted sublanguage id
JNA API 5.6.0

Copyright © 2007-2018 Timothy Wall. All Rights Reserved.