char* setlocale(int iCategory, const char* kcpLocale);
Category Macros Table
Macro | Description | Value |
LC_ALL | Affects all categories | 0 |
LC_COLLATE | Affects collate functions like strcoll() | 1 |
LC_CTYPE | Affects most ctype character functions | 2 |
LC_MONETARY | Affects monetary information | 3 |
LC_NUMERIC | Affects decimal point character | 4 |
LC_TIME | Affects time functions | 5 |
LC_MIN | Min value | 0 |
LC_MAX | Max value | 5 |
Locale Strings Table (Language)
Language | Strings |
Chinese | "chinese" |
Chinese (simplified) | "chinese-simplified" or "chs" |
Chinese (traditional) | "chinese-traditional" or "cht" |
Czech | "csy" or "czech" |
Danish | "dan" or "danish" |
Dutch (default) | "dutch" or "nld" |
Dutch (Belgium) | "belgian", "dutch-belgian", or "nlb" |
English (default) | "english" |
English (Australia) | "australian", "ena", or "english-aus" |
English (Canada) | "canadian", "enc", or "english-can" |
English (New Zealand) | "english-nz" or "enz" |
English (United Kingdom) | "eng", "english-uk", or "uk" |
English (United States) | "american", "american english", "american-english", "english-american", "english-us", "english-usa", "enu", "us", or "usa" |
Finnish | "fin" or "finnish" |
French (default) | "fra" or "french" |
French (Belgium) | "frb" or "french-belgian" |
French (Canada) | "frc" or "french-canadian" |
French (Switzerland) | "french-swiss" or "frs" |
German (default) | "deu" or "german" |
German (Austria) | "dea" or "german-austrian" |
German (Switzerland) | "des", "german-swiss", or "swiss" |
Greek | "ell" or "greek" |
Hungarian | "hun" or "hungarian" |
Icelandic | "icelandic" or "isl" |
Italian (default) | "ita" or "italian" |
Italian (Switzerland) | "italian-swiss" or "its" |
Japanese | "japanese" or "jpn" |
Korean | "kor" or "korean" |
Norwegian (default) | "norwegian" |
Norwegian (Bokmal) | "nor" or "norwegian-bokmal" |
Norwegian (Nynorsk) | "non" or "norwegian-nynorsk" |
Polish | "plk" or "polish" |
Portuguese (default) | "portuguese" or "ptg" |
Portuguese (Brazil) | "portuguese-brazilian" or "ptb" |
Russian (default) | "rus" or "russian" |
Slovak | "sky" or "slovak" |
Spanish (default) | "esp" or "spanish" |
Spanish (Mexico) | "esm" or "spanish-mexican" |
Spanish (Modern) | "esn" or "spanish-modern" |
Swedish | "sve" or "swedish" |
Turkish | "trk" or "turkish" |
Locale Strings Table (Regional)
Region | Strings |
Australia | "aus" or "australia" |
Austria | "aut" or "austria" |
Belgium | "bel" or "belgium" |
Brazil | "bra" or "brazil" |
Canada | "can" or "canada" |
China | "china", "chn", "pr china", or "pr-china" |
Czech Republic | "cze" or "czech" |
Denmark | "dnk" or "denmark" |
Finland | "fin" or "finland" |
France | "fra" or "france" |
Germany | "deu" or "germany" |
Greece | "grc" or "greece" |
Hong Kong SAR | "hkg", "hong kong", or "hong-kong" |
Hungary | "hun" or "hungary" |
Iceland | "iceland" or "isl" |
Ireland | "irl" or "ireland" |
Italy | "ita" or "italy" |
Japan | "jpn" or "japan" |
Korea | "kor" or "korea" |
Mexico | "mex" or "mexico" |
The Netherlands | "nld", "holland", or "netherlands" |
New Zealand | "nzl", "new zealand", "new-zealand", or "nz" |
Norway | "nor" or "norway" |
Poland | "pol" or "poland" |
Portugal | "prt" or "portugal" |
Russia | "rus" or "russia" |
Singapore | "sgp" or "singapore" |
Slovakia | "svk" or "slovak" |
Spain | "esp" or "spain" |
Sweden | "swe" or "sweden" |
Switzerland | "che" or "switzerland" |
Taiwan | "twn" or "taiwan" |
Turkey | "tur" or "turkey" |
United Kingdom | "gbr", "britain", "england", "great britain", "uk", "united kingdom", or "united-kingdom" |
United States | "usa", "america", "united states", "united-states", or "us" |
Locale Strings Table (Special)
Description | String |
Set nothing, just report | NULL |
Start up value | "C" |
User default from OS | "" |
Current OEM code page | ".OCP" |
ANSI code page | ".ACP" |
#include <iostream> #include <clocale> int main() { using namespace std; char* cpSettings = setlocale(LC_ALL, "usa"); cout << cpSettings << endl; return 0; }
© 20072024 XoaX.net LLC. All rights reserved.