Hi,
I have a char* string where I assigned a string literal with the British
pound symbol, which is included in the extended ASCII, at least on my OS.
However, when I cout the string, I get a modified u in place of the pound
symbol. Why is that? If I output the ASCII code of the pound symbol it
outputs just fine--but not when in a char*.
Interesting challenge.
I suggest a help search on the following:
1) extended ascii
2) cin
3) LC_CTYPE
4) setlocale
5) code pages
The information about "setlocale" is where I believe you will be lead
to the solution.
I am interested in hearing if you have success with setlocale. I have
never had the need for it before; thus, I am very curious.
Your country code appears to be "gbr". The following listing was found
in help:
-------------------
The following is a list of country/regions strings recognized by
setlocale. Strings for countries/regions that are not supported by the
operating system are not accepted by setlocale. Three-letter
country/region-name codes are from ISO/IEC (International Organization
for Standardization, International Electrotechnical Commission)
specification 3166.
Country/Region Country/Region String
Australia "aus" or "australia"
Austria "austria" or "aut"
Belgium "bel" or "belgium"
Brazil "bra" or "brazil"
Canada "can" or "canada"
Czech Republic "cze" or "czech"
Denmark "denmark" or "dnk"
Finland "fin" or "finland"
France "fra" or "france"
Germany "deu" or "germany"
Greece "grc" or "greece"
Hong Kong "hkg", "hong kong", or "hong-kong"
Hungary "hun" or "hungary"
Iceland "iceland" or "isl"
Ireland "ireland" or "irl"
Italy "ita" or "italy"
Japan "japan" or "jpn"
Mexico "mex" or "mexico"
Netherlands "nld", "holland", or "netherlands"
New Zealand "new zealand", "new-zealand", "nz", or "nzl"
Norway "nor" or "norway"
People’s Republic of China "china", "chn", "pr china", or "pr-china"
Poland "pol" or "poland"
Portugal "prt" or "portugal"
Russia "rus" or "russia"
Singapore "sgp" or "singapore"
Slovak Repubic "svk" or "slovak"
South Korea "kor", "korea", "south korea", or "south-korea"
Spain "esp" or "spain"
Sweden "swe" or "sweden"
Switzerland "che" or "switzerland"
Taiwan "taiwan" or "twn"
Turkey "tur" or "turkey"
United Kingdom "britain", "england", "gbr", "great britain", "uk",
"united kingdom", or "united-kingdom"
United States of America "america", "united states", "united-states",
"us", or "usa"