Locale naming conventions

The setlocale() library function that selects the active locale maps the descriptive locale name into the name of the locale object before loading the locale and making it accessible.

In z/OS® XL C/C++ programs, the locale modules are referred to by descriptive locale names. The locale names themselves are not case sensitive. They follow these conventions:
<Language>-<Territory>.<Codeset>
Language
is a two-letter uppercase abbreviation for the language name. The abbreviations come from the ISO 639 standard.
Territory
is a two-letter uppercase abbreviation for the territory name. The abbreviation comes from the ISO 3166 standard.
Codeset
is the name registered by the MIT X Consortium that identifies the registration authority that owns the specific encoding. A modifier may be added to the registered name but is not required. The modifier is of the form @codeset modifier and identifies the coded character set as defined by that registration authority.

The Codeset parts are optional. If they are not specified, Codeset defaults to IBM-nnn, where nnn is the default code page, which for EBCDIC locales is shown in Table 2 and for ASCII locales in Table 3. (The modifier portion defaults to nothing.)

For PDS resident locales, the mapping between the descriptive locale name and the eight-character name of the locale object is performed as follows:
  1. The Language-Territory part is mapped into a two-letter LT code.
  2. The Codeset part is mapped into a two-letter CC code.
  3. The object name is built from a prefix, the two-letter LT code, and the two-letter CC code. The prefix is one of the following show in Table 1. (Note that the @-sign in the PDS and z/OS UNIX locale names always has Latin-1/Open Systems encoding; see IBM®-1047 CHARMAP.)
    Table 1. Locale object prefix
    Application No modifier @euro modifier @preeuro modifier
    non-XPLINK EDC$ EDC@ EDC3
    XPLINK CEH$ CEH@ CEH3
    XPLINK ASCII CEJ$ NA NA
    AMODE 64 CEQ$ CEQ@ CEQ3
    AMODE 64 ASCII CEZ$ NA NA
Type Mapping
Non-XPLINK
Fr_BE.IBM-1148 maps to EDC$FBHO
Fr_BE.IBM-1148@euro maps to EDC@FBHO
Fr_BE.IBM-1148@preeuro maps to EDC3FBHO
XPLINK
Fr_BE.IBM-1148 maps to CEH$FBHO
Fr_BE.IBM-1148@euro maps to CEH@FBHO
Fr_BE.IBM-1148@preeuro maps to CEH3FBHO
ASCII
Fr_BE.ISO8859-1 maps to CEJ$FBI1
Fr_BE.UTF-8 maps to CEJ$FBU8
AMODE 64
Fr_BE.IBM-1148 maps to CEQ$FBHO
Fr_BE.IBM-1148@euro maps to CEQ@FBHO
Fr_BE.IBM-1148@preeuro maps to CEQ3FBHO
AMODE 64 ASCII
Fr_BE.ISO8859-1 maps to CEZ$FBI1
Fr_BE.UTF-8 maps to CEZ$FBU8
For resident locales in the z/OS UNIX file system, the mapping between the descriptive locale name and the z/OS UNIX file name is performed as follows:
  1. The locale object file name starts out the same as the descriptive name.
  2. If the locale object is XPLINK, add a suffix of ".xplink" to the end of the object file name.
  3. If the locale object is AMODE 64, add a suffix of ".lp64" to the end of the object file name.
Type Mapping
Non-XPLINK
Fr_BE.IBM-1148 maps to Fr_BE.IBM-1148
Fr_BE.IBM-1148@euro maps to Fr_BE.IBM-1148@euro
Fr_BE.IBM-1148@preeuro maps to Fr_BE.IBM-1148@preeuro
XPLINK
Fr_BE.IBM-1148 maps to Fr_BE.IBM-1148.xplink
Fr_BE.IBM-1148@euro maps to Fr_BE.IBM-1148@euro.xplink
Fr_BE.IBM-1148@preeuro maps to Fr_BE.IBM-1148@preeuro.xplink
ASCII
Fr_BE.ISO8859-1 maps to Fr_BE.ISO8859-1.xplink
Fr_BE.UTF-8 maps to Fr_BE.UTF-8.xplink
AMODE 64
Fr_BE.IBM-1148 maps to FR_BE.IBM-1148.lp64
Fr_BE.IBM-1148@euro maps to Fr_BE.IBM-1148@euro.lp64
Fr_BE.IBM-1148@preeuro maps to Fr_BE.IBM-1148@preeuro.lp64
AMODE 64 ASCII
Fr_BE.ISO8859-1 maps to Fr_BE.ISO8859-1.lp64
Fr_BE.UTF-8 maps to Fr_BE.UTF-8.lp64
The mapping between Language-Territory and the two-letter LT code is defined in the LT conversion table EDC$LCNM, built with assembler macros as follows:
EDC$LCNM TITLE 'LOCALE NAME CONVERSION TABLE'
EDC$LCNM CSECT
         EDCLOCNM TYPE=ENTRY,LOCALE='DA_DK',CODESET='IBM-1047',CODE='DA'
         EDCLOCNM TYPE=ENTRY,LOCALE='DE_BE',CODESET='IBM-1047',CODE='DB'
         EDCLOCNM TYPE=ENTRY,LOCALE='DE_CH',CODESET='IBM-1047',CODE='DC'
         EDCLOCNM TYPE=ENTRY,LOCALE='DE_DE',CODESET='IBM-1047',CODE='DD'
         EDCLOCNM TYPE=ENTRY,LOCALE='JA_JP',CODESET='IBM-939',CODE='EJ'
⋮
         EDCLOCNM TYPE=END
         END   EDC$LCNM

LOCALE specifies the name of Language-Territory, while CODE specifies the respective LT code.

You can customize this table by adding new LOCALE name mappings. z/OS XL C/C++ reserves alphabetic LT codes, but you can use codes containing numeric values for your own customized names.

The Language-Territory names and their mappings into LT codes that are provided are shown in Table 2 .

Table 2. Supported language-territory names and LT codes for EBCDIC locales
Locale Name Language Country/Territory EBCDIC Codeset 2-Byte LT Code
Ar_AA Arabic Algeria, Bahrain, Egypt, Iraq, Jordan, Kuwait, Lebanon, Libya, Morocco, Oman, Qatar, Saudi Arabia, Syria, Tunisia, U.A.E., Yemen IBM-425 AR
Be_BY Byelorussian Belarus IBM-1025 BB
Bg_BG Bulgarian Bulgaria IBM-1025 BG
C     IBM-1047 CC
Ca_ES Catalan Spain IBM-924 CS
Cs_CZ Czech Czech Republic IBM-870 CZ
Da_DK Danish Denmark IBM-1047 DA
De_AT German Austria IBM-924 DT
De_CH German Switzerland IBM-1047 DC
De_DE German Germany IBM-1047 DD
De_LU German Luxembourg IBM-924 DL
El_GR Greek Greece IBM-875 EL
En_AU English Australia IBM-1047 NA
En_BE English Belgium IBM-924 EB
En_CA English Canada IBM-1047 EC
En_GB English United Kingdom IBM-1047 EK
En_HK English China (Hong Kong S.A.R. of China) IBM-1047 NH
En_IE English Ireland IBM-924 EI
En_IN English India IBM-1047 NI
En_JP English Japan IBM-1027 EJ
En_NZ English New Zealand IBM-1047 NZ
En_PH English Philipines IBM-1047 NP
En_SG English Singapore IBM-1047 NS
En_US English United States IBM-1047 EU
En_ZA English South Africa IBM-1047 EZ
Es_AR Spanish Argentina IBM-1047 EA
Es_BO Spanish Bolivia IBM-1047 EO
Es_CL Spanish Chile IBM-1047 EH
Es_CO Spanish Colombia IBM-1047 FG
Es_CR Spanish Costa Rica IBM-1047 ER
Es_DO Spanish Dominican Republic IBM-1047 ED
Es_EC Spanish Ecuador IBM-1047 EQ
Es_ES Spanish Spain IBM-1047 ES
Es_GT Spanish Guatemala IBM-1047 EG
Es_HN Spanish Honduras IBM-1047 FE
Es_MX Spanish Mexico IBM-1047 EM
Es_NI Spanish Nicaragua IBM-1047 FA
Es_PA Spanish Panama IBM-1047 EP
Es_PE Spanish Peru IBM-1047 EW
Es_PR Spanish Puerto Rico IBM-1047 EX
Es_PY Spanish Paraguay IBM-1047 EY
Es_SV Spanish El Salvador IBM-1047 EV
Es_US Spanish United States IBM-1047 ET
Es_UY Spanish Uruguay IBM-1047 FD
Es_VE Spanish Venezuela IBM-1047 EF
Et_EE Estonian Estonia IBM-1122 EE
Fi_FI Finnish Finland IBM-1047 FI
Fr_BE French Belgium IBM-1047 FB
Fr_CA French Canada IBM-1047 FC
Fr_CH French Switzerland IBM-1047 FS
Fr_FR French France IBM-1047 FF
Fr_LU French Luxembourg IBM-924 FL
He_IL Hebrew Israel IBM-424 IL
Hr_HR Croatian Croatia IBM-870 HR
Hu_HU Hungarian Hungary IBM-870 HU
Id_ID Indonesian Indonesia IBM-1047 II
It_CH Italian Switzerland IBM-1047 IC
Is_IS Icelandic Iceland IBM-871 IS
It_IT Italian Italy IBM-1047 IT
Ja_JP Japanese Japan IBM-939 JA
Ko_KR Korean Korea IBM-933 KR
Iw_IL Hebrew Israel IBM-424 IL
Lt-LT Lithuanian Lithuania IBM-1112 LT
Lv_LV Latvian Latvia IBM-1112 LL
Mk_MK Macedonian Macedonia IBM-1025 MM
Ms_MY Malay Malaysia IBM-1047 MY
Nl_BE Dutch Belgium IBM-1047 NB
Nl_NL Dutch The Netherlands IBM-1047 NN
No_NO Norwegian Norway IBM-1047 NO
Pl_PL Polish Poland IBM-870 PL
Pt_BR Portuguese Brazil IBM-1047 BR
Pt_PT Portuguese Portugal IBM-1047 PT
Ro_RO Romanian Romania IBM-870 RO
Ru_RU Russian Russia IBM-1025 RU
Sh_SP Serbian (Latin) Serbia IBM-870 SL
Sk_SK Slovak Slovakia IBM-870 SK
Sl_SI Slovene Slovenia IBM-870 SI
Sq_AL Albanian Albania IBM-500 SA
Sr_SP Serbian (Cyrillic) Serbia IBM-1025 SC
Sv_SE Swedish Sweden IBM-1047 SV
Th_TH Thai Thailand IBM-838 TH
Tr_TR Turkish Turkey IBM-1026 TR
UK_UA Ukranian Ukraine IBM-1125 UU
Zh_CN Simplified Chinese China (PRC) IBM-935 ZC
Zh_TW Traditional Chinese Taiwan IBM-937 ZT

Table 3 shows the supported language-territory names and LT codes for ASCII locales. Note that ASCII locale names can also be coded <uppercase><lowercase>_<uppercase><uppercase>. For example, both en_US and En_US are valid ASCII locale names.

Table 3. Supported language-territory names and LT codes for ASCII locales
Locale Name Language Country/Territory ASCII Codeset 2-Byte LT Code
be_BY Byelorussian Belarus ISO8859-5 BB
bn_IN Bengali India UTF-8 BN
en_CA English Canada ISO8859-1 EC
cs_CZ Czech Czech Republic ISO8859-2 CZ
en_ZA English South Africa ISO8859-1 EZ
da_DK Danish Denmark ISO8859-1 DA
de_CH German Switzerland ISO8859-1 DC
de_DE German Germany ISO8859-1 DD
el_GR Greek Greece ISO8859-7 EL
en_AU English Australia ISO8859-1 NA
en_GB English United Kingdom ISO8859-1 EK
en_HK English China (Hong Kong S.A.R. of China) ISO8859-1 NH
en_IN English India ISO8859-1 NI
en_NZ English New Zealand ISO8859-1 NZ
en_PH English Philipines ISO8859-1 NP
en_SG English Singapore ISO8859-1 NS
en_US English United States ISO8859-1 EU
es_AR Spanish Argentina ISO8859-1 EA
es_BO Spanish Bolivia ISO8859-1 EO
es_CL Spanish Chile ISO8859-1 EH
es_CO Spanish Colombia ISO8859-1 FG
es_CR Spanish Costa Rica ISO8859-1 ER
es_DO Spanish Dominican Republic ISO8859-1 ED
es_EC Spanish Ecuador ISO8859-1 EQ
es_ES Spanish Spain ISO8859-1 ES
es_GT Spanish Guatemala ISO8859-1 EG
es_HN Spanish Honduras ISO8859-1 FE
es_MX Spanish Mexico ISO8859-1 EM
es_NI Spanish Nicaragua ISO8859-1 FA
es_PA Spanish Panama ISO8859-1 EP
es_PE Spanish Peru ISO8859-1 EW
es_PR Spanish Puerto Rico ISO8859-1 EX
es_PY Spanish Paraguay ISO8859-1 EY
es_SV Spanish El Salvador ISO8859-1 EV
es_US Spanish United States ISO8859-1 ET
es_UY Spanish Uruguay ISO8859-1 FD
es_VE Spanish Venezuela ISO8859-1 EF
fi_FI Finnish Finland ISO8859-1 FI
fr_BE French Belgium ISO8859-1 FB
fr_CA French Canada ISO8859-1 FC
fr_CH French Switzerland ISO8859-1 FS
fr_FR French France ISO8859-1 FF
gu_IN Gujarati India UTF-8 GI
he_IL Hebrew Israel ISO8859-8 IL
hi_IN Hindi India UTF-8 IN
hr_HR Croatian Croatia ISO8859-2 HR
hu_HU Hungarian Hungary ISO8859-2 HU
id_ID Indonesian Indonesia ISO8859-1 II
it_CH Italian Switzerland ISO8859-1 IC
it_IT Italian Italy ISO8859-1 IT
iw_IL Hebrew Israel ISO8859-8 IL
ja_JP Japanese Japan IBM-943 JA
kk_KZ Kazakh Kazakstan UTF-8 KK
ko_KR Korean Korea IBM-eucKR KR
mr_IN Marati India UTF-8 MI
ms_MY Malay Malaysia ISO8859-1 MY
nl_NL Dutch Netherlands ISO8859-1 NN
no_NO Norwegian Norway ISO8859-1 NO
pa_IN Punjabi India UTF-8 PI
pl_PL Polish Poland ISO8859-2 PL
pt_BR Portuguese Brazil ISO8859-1 BR
pt_PT Portuguese Portugal ISO8859-1 PT
ro_RO Romanian Romania ISO8859-2 RO
ru_RU Russian Russia ISO8859-5 RU
sk_SK Slovak Slovakia ISO8859-2 SK
sl_SI Slovene Slovenia ISO8859-2 SI
sv_SE Swedish Sweden ISO8859-1 SV
ta_IN Tamil India UTF-8 AN
te_IN Telugu India UTF-8 EN
th_TH Thai Thailand TIS-620 TH
tr_TR Turkish Turkey ISO8859-9 TR
zh_CN Simplified Chinese China (PRC) IBM-eucCN ZC
zh_HKS Simplified Chinese China (Hong Kong S.A.R. of China) UTF-8 ZG
zh_HKT Traditional Chinese China (Hong Kong S.A.R. of China) UTF-8 ZU
zh_SGS Simplified Chinese Singapore UTF-8 ZS
zh_TW Simplified Chinese Taiwan BIG5 ZT
The mapping between Codeset and the two-letter CC code is defined in the CC conversion table EDCUCSNM. This table is built with assembler macros, as follows:
EDCUCSNM TITLE 'CODE SET NAME CONVERSION TABLE'
EDCUCSNM CSECT
         EDCCSNAM TYPE=ENTRY,CODESET='IBM-037',CODE='EA'
         EDCCSNAM TYPE=ENTRY,CODESET='IBM-273',CODE='EB'
         EDCCSNAM TYPE=ENTRY,CODESET='IBM-274',CODE='EC'
         EDCCSNAM TYPE=ENTRY,CODESET='IBM-277',CODE='ED'
         EDCCSNAM TYPE=ENTRY,CODESET='IBM-278',CODE='EE'
         ⋮
         EDCCSNAM TYPE=END
         END   EDCUCSNM

CODESET specifies the name Codeset; CODE specifies the respective CC code.

You can customize this table by adding new CODESET names. The alphabetic codes in the first byte of each CC name are reserved by IBM for future use, but you can use codes starting with numeric values for your own customized names.

Table 4 lists the Codeset names and their mappings into CC codes that are provided.
Table 4. Supported codeset names and CC codes
Codesets Primary Country or Territory 2-Byte CC code
Big5 Taiwan BT
IBM-037 USA, Canada, Brazil EA
IBM-273 Germany, Austria EB
IBM-274 Belgium EC
IBM-277 Denmark, Norway EE
IBM-278 Finland, Sweden EF
IBM-280 Italy EG
IBM-282 Portugal EI
IBM-284 Spain, Latin America EJ
IBM-285 United Kingdom EK
IBM-290 Japan (Katakana) EL
IBM-297 France EM
IBM-300 Japanese DBCS EN
IBM-420 Algeria, Bahrain, Egypt, Iraq, Jordan, Kuwait, Lebanon, Libya, Morocco, Oman, Qatar, Saudi Arabia, Syria, Tunisia, U.A.E., Yemen FF
IBM-424 Israel FB
IBM-425 Algeria, Bahrain, Egypt, Iraq, Jordan, Kuwait, Lebanon, Libya, Morocco, Oman, Qatar, Saudi Arabia, Syria, Tunisia, U.A.E., Yemen AR
IBM-500 International EO
IBM-838 Thailand EP
IBM-848 Ukraine with Euro (Cyrillic) AS
IBM-870 Croatia, Czech Republic, Hungary, Poland, Romania, Serbia(Latin), Slovakia, Slovenia EQ
IBM-871 Iceland ER
IBM-875 Greece ES
IBM-880 Cyrillic ET
IBM-924 Latin 9/Open Systems DL
IBM-930 Japan Katakana Extended (combined with DBCS) EU
IBM-933 Korea GZ
IBM-935 China(PRC) GY
IBM-937 Taiwan GW
IBM-943 Japan JA
IBM-943 China (PRC) No
IBM-943G Japan AN
IBM-1025 Bulgaria, Macedonia, Russia, Serbia (Cyrillic) FE
IBM-1026 Turkey EW
IBM-1027 Japan (Latin) Extended EX
IBM-1047 Latin 1/Open Systems EY
IBM-1112 Lithuania GD
IBM-1122 Estonia FD
IBM-1123 Ukraine (Cyrillic) FH
IBM-1125 Ukraine (Cyrillic) AT
IBM-1140 USA, Canada, Brazil HA
IBM-1141 Austria, Germany HB
IBM-1142 Denmark, Norway HE
IBM-1143 Finland, Sweden HF
IBM-1144 Italy HG
IBM-1145 Spain, Latin America HJ
IBM-1146 United Kingdom HK
IBM-1147 France HM
IBM-1148 International HO
IBM-1149 Iceland HR
IBM-1153 Czech Republic, Hungary, Poland, Slovakia, Slovenia MB
IBM-1156 Latvia, Lithuania HZ
IBM-1157 Estonia HD
IBM-1158 Ukraine with Euro (Cyrillic) FI
IBM-1165 Latin 2/Open Systems FG
IBM-1364 Korea KZ
IBM-1371 Taiwan ZT
IBM-1388 China (PRC) GV
IBM-1390 Japan HU
IBM-1399 Japan HV
IBM-4933 China (PRC) FJ
IBM-4971 Greece HS
IBM-13124 China (PRC) FK
IBM-53668 Algeria, Behrain, Egypt, Iraq, Jordan, Kuwait, Lebanon, Libya, Morocco, Oman, Qatar, Saudia Arabia, Syria, Tunisia, U.A.E., Yemen FV
IBMEUCCN China (PRC) BY
IBMEUCKR Korea BZ
ISO8859-1 All Latin 1 Countries I1
ISO8859-2 Croatia, Czech Republic, Hungary, Poland, Romania, Serbia (Latin), Slovakia, Slovenia I2
ISO8859-5 Bulgaria, Macedonia, Russia, Serbia (Cyrillic) I5
ISO8859-7 Greece I7
ISO8859-8 Israel I8
ISO8859-9 Turkey I9
TIS–620 Thailand BU
UTF-8 All Countries F8
The exceptions to the rule above are the following special locale names, which are already recognized:
  • C (EBCDIC and ASCII)
  • POSIX (EBCDIC and ASCII)
  • SAA (EBCDIC only)
  • S370 (EBCDIC only)
The special names C, POSIX, SAA, and S370 always refer to the built-in locales, which cannot be modified. The S370 locale and the following names are for locales in an old format, created with the EDCLOC assembler macro, rather than with the localedef utility:
  • GERM (EBCDIC only)
  • FRAN (EBCDIC only)
  • UK (EBCDIC only)
  • ITAL (EBCDIC only)
  • SPAI (EBCDIC only)
  • USA (EBCDIC only)

The EDCLOC generated locales are not supported in AMODE 64 applications.

You can use the C macros in Table 5, which are defined in the locale.h header file, as synonyms for these special locale names. These macros can only be used for EBCDIC locales. The <prefix> in the Compiled locale column is EDC for non-XPLINK locales and CEH for XPLINK locales. The C macros for the locales which list a prefix in the Compiled locales column, are not defined for AMODE 64 compilations.

Table 5. C macros used as synonyms for special locale names
Macro Locale Compiled locale
LC_C C Not applicable
LC_POSIX POSIX Not applicable
LC_C_GERMANY "GERM" <prefix>$GERM
LC_C_FRANCE "FRAN" <prefix>$FRAN
LC_C_UK "UK" <prefix>$UK
LC_C_ITALY "ITAL" <prefix>$ITAL
LC_C_SPAIN "SPAI" <prefix>$SPAI
LC_C_USA "USA" <prefix>$USA

The predefined name for the built-in locale in the old format is S370.

The rest of the special names refer to the EBCDIC locale objects whose names are built by prepending the letters EDC$ for non-XPLINK locales or CEH$ for XPLINK locales to the special name, as for EDC$FRAN.