Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

setlocale

Status
Not open for further replies.

Samprayoga

Programmer
Apr 10, 2002
7
0
0
FR
Hello,

I use the following source code to get the os Language:

int getOsLanguage(string& strOsLanguage){
char* strLang;
string strOsLanguage
size_t new_size = 0;

setlocale(LC_ALL,"");
strLang = setlocale(LC_ALL,0);
if(strLang == 0)
return 1;
strOsLanguage.assign(strLang);
return 0;
}
Unfortunetally strOsLanguage is equal to "C"??
Why?
Is anybody can help me?

PS:I use Sun Solaris 5.5.1.

S.
 
The value "C" indicates the standard Unix behaviour, which I would assume means English language. Note there is also an environment variable LANG that you might want to look at. (getenv("LANG");
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top