Previous fileTop of DocumentContentsIndex pageNext file
Apache C++ Standard Library Reference Guide

locale

Library:  Localization


Does not inherit

Local Index

Members

Summary

A class that serves as a container for a set of polymorphic objects called facets that facilitate internationalization and localization.

Synopsis

#include <locale> 

namespace std {
  class locale;
}

Description

Class locale provides facilities for the creation and management of a set of objects called facets, indexed by their type, each of which addresses one particular area of internationalization and localization. The default locale object is based on the semantics of the classic C locale. Locale objects can be constructed with semantics of named locales, from parts of two other locale objects, or to include facet objects of user defined types.

Objects of class locale have the following important characteristics:

In this implementation, a locale object will have a name if it contains no facet objects constructed by user code, and if for each of the six standard categories of facets described below, all facet objects within each category logically belong to the same locale.

A program can determine whether a facet of a particular type is contained in a locale object by using the has_facet() function template, and the program can obtain a reference to that facet object with the use_facet() function template. These are not member functions, but instead take a locale object as an argument and a type of facet as a template parameter.

Interface

Member Types

category
facet
id

Constructors

locale() throw();
locale(const locale& other) throw();
explicit locale(const char* name); 
locale(const locale& other, const char* name,
       category cat); 
template <class Facet> 
locale(const locale& other, Facet* f); 
locale(const locale& other, const locale& one, 
       category cat); 

Destructors

~locale();

Public Member Operators

const locale& 
operator=(const locale& other) throw();
bool 
operator==(const locale& other) const; 
bool 
operator!=(const locale& other) const; 
template <class charT, class Traits, class Allocator>
bool 
operator()(const basic_string<charT, Traits, Allocator>& s1,
           const basic_string<charT, Traits, Allocator>& s2)
           const;

Public Member Functions

template <class Facet> 
locale combine(const locale& other) const; 
string 
name() const; 

Static Public Member Functions

static const locale& 
classic();
static locale 
global(const locale& loc); 

Included Locales

Table 21 lists the locale definition files that correspond with the the locales of the Apache C++ Standard Library. The names conform to ISO 639:1998, the Code for the Representation of Names of Languages, and ISO 3166, the Country Names and Codes. The Default Codeset gives the name of the codeset or the encoding the locales are designed to be encoded in. The names follow those outlined by IANA in its Assigned Character Set Names. In addition to the listed codeset, each locale can be encoded in UTF-8, and may be able to use other encodings as well.

Table 21: Locale definition files 

Locale Name Language Country Default Codeset

af_ZA

Afrikaans

South Africa

ISO-8859-1

ar_AE

Arabic

United Arab Emirates

ISO-8859-6

ar_BH

Arabic

Bahrain

ISO-8859-6

ar_DZ

Arabic

Algeria

ISO-8859-6

ar_EG

Arabic

Egypt

ISO-8859-6

ar_IN

Arabic

India

UTF-8

ar_IQ

Arabic

Iraq

ISO-8859-6

ar_JO

Arabic

Jordan

ISO-8859-6

ar_KW

Arabic

Kuwait

ISO-8859-6

ar_LB

Arabic

Lebanon

ISO-8859-6

ar_LY

Arabic

Libya

ISO-8859-6

ar_MA

Arabic

Morocco

ISO-8859-6

ar_OM

Arabic

Oman

ISO-8859-6

ar_QA

Arabic

Qatar

ISO-8859-6

ar_SA

Arabic

Saudi Arabia

ISO-8859-6

ar_SY

Arabic

Syria

ISO-8859-6

ar_SD

Arabic

Sudan

ISO-8859-6

ar_TN

Arabic

Tunisia

ISO-8859-6

ar_YE

Arabic

Yemen

ISO-8859-6

be_BY

Byelorussian

Byelorussia

CP1251

bg_BG

Bulgarian

Bulgaria

CP1251

br_FR

Breton

France

ISO-8859-1

bs_BA

Bosnian

Bosnia

ISO-8859-2

ca_ES

Catalan

Spain

ISO-8859-1

ca_ES@euro

Catalan

Spain

ISO-8859-15

cs_CZ

Czech

Czech Republic

ISO-8859-2

cy_GB

Welsh

Great Britain

ISO-8859-14

da_DK

Danish

Denmark

ISO-8859-1

de_AT

German

Austria

ISO-8859-1

de_AT@euro

German

Austria

ISO-8859-15

de_BE

German

Belgium

ISO-8859-1

de_BE@euro

German

Belgium

ISO-8859-15

de_CH

German

Switzerland

ISO-8859-1

de_DE

German

Germany

ISO-8859-1

de_DE@euro

German

Germany

ISO-8859-15

de_LU

German

Luxembourg

ISO-8859-1

de_LU@euro

German

Luxembourg

ISO-8859-15

el_GR

Greek

Greece

ISO-8859-7

en_AU

English

Australia

ISO-8859-1

en_BW

English

Botswana

ISO-8859-1

en_CA

English

Canada

ISO-8859-1

en_DK

English

Denmark

ISO-8859-1

en_GB

English

Great Britain

ISO-8859-1

en_HK

English

Hong Kong

ISO-8859-1

en_IE

English

Ireland

ISO-8859-1

en_IE@euro

English

Ireland

ISO-8859-15

en_IN

English

India

UTF-8

en_NZ

English

New Zealand

ISO-8859-1

en_PH

English

Philippines

ISO-8859-1

en_SG

English

Singapore

ISO-8859-1

en_US

English

USA

ISO-8859-1

en_ZA

English

South Africa

ISO-8859-1

en_ZW

English

Zimbabwe

ISO-8859-1

es_AR

Spanish

Argentina

ISO-8859-1

es_BO

Spanish

Bolivia

ISO-8859-1

es_CL

Spanish

Chile

ISO-8859-1

es_CO

Spanish

Colombia

ISO-8859-1

es_CR

Spanish

Costa Rica

ISO-8859-1

es_DO

Spanish

Dominican Republic

ISO-8859-1

es_EC

Spanish

Ecuador

ISO-8859-1

es_ES

Spanish

Spain

ISO-8859-1

es_ES@euro

Spanish

Spain

ISO-8859-15

es_GT

Spanish

Guatemala

ISO-8859-1

es_HN

Spanish

Honduras

ISO-8859-1

es_MX

Spanish

Mexico

ISO-8859-1

es_NI

Spanish

Nicaragua

ISO-8859-1

es_PA

Spanish

Panama

ISO-8859-1

es_PE

Spanish

Peru

ISO-8859-1

es_PR

Spanish

Puerto Rico

ISO-8859-1

es_PY

Spanish

Paraguay

ISO-8859-1

es_SV

Spanish

El Salvador

ISO-8859-1

es_US

Spanish

USA

ISO-8859-1

es_UY

Spanish

Uruguay

ISO-8859-1

es_VE

Spanish

Venezuela

ISO-8859-1

et_EE

Estonian

Estonia

ISO-8859-1

eu_ES

Basque

Spain

ISO-8859-1

eu_ES@euro

Basque

Spain

ISO-8859-15

fa_IR

Farsi

Iran

UTF-8

fi_FI

Finnish

Finland

ISO-8859-1

fi_FI@euro

Finnish

Finland

ISO-8859-15

fo_FO

Faroese

Faroe

ISO-8859-1

fr_BE

French

Belgium

ISO-8859-1

fr_BE@euro

French

Belgium

ISO-8859-15

fr_CA

French

Canada

ISO-8859-1

fr_CH

French

Switzerland

ISO-8859-1

fr_FR

French

France

ISO-8859-1

fr_FR@euro

French

France

ISO-8859-15

fr_LU

French

Luxembourg

ISO-8859-1

fr_LU@euro

French

Luxembourg

ISO-8859-15

ga_IE

Irish

Ireland

ISO-8859-1

ga_IE@euro

Irish

Ireland

ISO-8859-15

gl_ES

Galician

Spain

ISO-8859-1

gl_ES@euro

Galician

Spain

ISO-8859-15

gv_GB

Gaelic

Great Britain

ISO-8859-1

he_IL

Hebrew

Israel

ISO-8859-8

hi_IN

Hindu

India

UTF-8

hr_HR

Croatian

Croatia

ISO-8859-2

hu_HU

Hungarian

Hungary

ISO-8859-2

id_ID

Indonesian

Indonesia

ISO-8859-1

is_IS

Icelandic

Iceland

ISO-8859-1

it_CH

Italian

Switzerland

ISO-8859-1

it_IT

Italian

Italy

ISO-8859-1

it_IT@euro

Italian

Italy

ISO-8859-15

iw_IL

Hebrew

Israel

ISO-8859-8

ja_JP

Japanese

Japan

EUC-JP

ja_JP

Japanese

Japan

UTF-8

ja_JP

Japanese

Japan

Shift_JIS

ka_GE

Georgian

Georgia

GEORGIAN-PS

kl_GL

Greenlandic

Greenland

ISO-8859-1

ko_KR

Korean

Korea

EUC-KR

ko_KR

Korean

Korea

UTF-8

kw_GB

Cornish

Great Britain

ISO-8859-1

lt_LT

Lithuanian

Lithuania

ISO-8859-13

lv_LV

Latvian

Latvia

ISO-8859-13

mi_NZ

Maori

New Zealand

ISO-8859-13

mk_MK

Macedonian

Macedonia

ISO-8859-5

mr_IN

Marathi

India

UTF-8

ms_MY

Malay

Malaysia

ISO-8859-1

mt_MT

Maltese

Malta

ISO-8859-3

nl_BE

Dutch

Belgium

ISO-8859-1

nl_BE@euro

Dutch

Belgium

ISO-8859-15

nl_NL

Dutch

Netherlands

ISO-8859-1

nl_NL@euro

Dutch

Netherlands

ISO-8859-15

nn_NO

Nynorsk

Norway

ISO-8859-1

no_NO

Norwegian

Norway

ISO-8859-1

oc_FR

Occitan

France

ISO-8859-1

pl_PL

Polish

Poland

ISO-8859-2

pt_BR

Portuguese

Brazil

ISO-8859-1

pt_PT

Portuguese

Portugal

ISO-8859-1

pt_PT@euro

Portuguese

Portugal

ISO-8859-15

ro_RO

Romanian

Romania

ISO-8859-2

ru_RU

Russian

Russia

ISO-8859-5

ru_RU

Russian

Russia

KOI8-R

ru_UA

Russian

Ukraine

KOI8-U

sk_SK

Slovak

Slovakia

ISO-8859-2

sl_SI

Slovenian

Slovenia

ISO-8859-2

sq_AL

Albanian

Albania

ISO-8859-1

sr_YU

Serbian

Yugoslavia

ISO-8859-2

sr_YU@cyrillic

Serbian

Yugoslavia

ISO-8859-5

sv_FI

Swedish

Finland

ISO-8859-1

sv_FI@euro

Swedish

Finland

ISO-8859-15

sv_SE

Swedish

Sweden

ISO-8859-1

ta_IN

Tamil

India

UTF-8

te_IN

Telgu

India

UTF-8

tg_TJ

Tadjik

Tadjikistan

KOI8-T

th_TH

Thai

Thailand

TIS-620

tl_PH

Tagalog

Philippines

ISO-8859-1

tr_TR

Turkish

Turkey

ISO-8859-9

uk_UA

Ukrainian

Ukraine

KOI8-U

ur_PK

Urdu

Pakistan

UTF-8

uz_UZ

Uzbek

Uzbekistan

ISO-8859-1

vi_VN

Vietnamese

Vietnam

UTF-8

yi_US

Yiddish

USA

CP1255

zh_CN

Chinese

China

GB2312

zh_CN

Chinese

China

GB18030

zh_CN

Chinese

China

GBK

zh_HK

Chinese

China

BIG5-HKSCS

zh_TW

Chinese

China

BIG5

zh_TW

Chinese

China

EUC-TW

Example

See Also

Facets, has_facet(), use_facet(), localedef, and specific facet reference sections: collate, collate_byname, ctype, codecvt, ctype_byname, codecvt_byname, moneypunct, moneypunct_byname, money_put, money_get, numpunct, numpunct_byname, num_put, num_get, time_put, time_put_byname, time_get, time_get_byname, messages, messages_byname

Standards Conformance

ISO/IEC 14882:1998 -- International Standard for Information Systems -- Programming Language C++, Section 22.1.1



Previous fileTop of DocumentContentsIndex pageNext file