site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to:in-reply-to:content-type:content-transfer-encoding:mime-version:subject:date:references:x-mailer; bh=+ZhZUvL/vrL5DlSBh18zom/rlFqRTU2RgJmiSQotmoc=; b=G34SWiMsslGtN6mki4qgQ1zs6bDHjuyoqcyOTTlufyW2jAfZwfSSRvNyYz9jksBwayDOw8awGys3IPq1FeTv9V4qGzvInlFJCrd0D6OtLVDhUwgrnbAaQdJNBmT03GFRnc+ypyX6ueBZ+tkVz3zlchlS5uZo90Mp5VztNN13hTY= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type:content-transfer-encoding:mime-version:subject:date:references:x-mailer; b=v/P3r3FeoDRtnVrTy8zkBTcp2WbhIxlWUgXO9RgaEsValPVMbude1iYiaTVSMFjYAxcLWcpOxDgCvFvup7xXEfMGXkX2viHiXHvkwKDHwf0tOa0Xbtr8bizUvsFp+/64WqZSEh5wXj2hAq+Bb8wxu+srrsi+Hoh2oY+cLBwQ9lw= I made a small mistake when writing my initial message. === BEGING TERMINAL OUTPUT === Trying c locales... Succeeded in calling setlocale(LC_ALL, "C") Succeeded in calling setlocale(LC_ALL, "POSIX") Succeeded in calling setlocale(LC_ALL, "en_US") Succeeded in calling setlocale(LC_ALL, "en_US.UTF-8") Succeeded in calling setlocale(LC_ALL, "pl_PL") Succeeded in calling setlocale(LC_ALL, "pl_PL.ISO8859-2") -Patrick On Mar 8, 2008, at 9:57 PM, Patrick Rutkowski wrote: === BEGING TERMINAL OUTPUT === Trying c locales... Succeeded in calling setlocale(LC_ALL, "C") Succeeded in calling setlocale(LC_ALL, "POSIX") Succeeded in calling setlocale(LC_ALL, "en_US") Succeeded in calling setlocale(LC_ALL, "en_US.UTF-8") Succeeded in calling setlocale(LC_ALL, "pl_PL") Succeeded in calling setlocale(LC_ALL, "pl_PL.ISO8859-2") Trying C++ locales... Succeeded ctor for std::locale with "C" Succeeded ctor for std::locale with "POSIX" Succeeded ctor for std::locale with "en_US" Succeeded ctor for std::locale with "en_US.UTF-8" Succeeded ctor for std::locale with "pl_PL" Succeeded ctor for std::locale with "pl_PL.ISO8859-2" === END TERMINAL OUTPUT === === BEGING TERMINAL OUTPUT === Trying c locales... Succeeded in calling setlocale(LC_ALL, "C") Succeeded in calling setlocale(LC_ALL, "POSIX") Succeeded in calling setlocale(LC_ALL, "en_US") Succeeded in calling setlocale(LC_ALL, "en_US.UTF-8") Succeeded in calling setlocale(LC_ALL, "pl_PL") Succeeded in calling setlocale(LC_ALL, "pl_PL.ISO8859-2") Trying C++ locales... Succeeded ctor for std::locale with "C" Succeeded ctor for std::locale with "POSIX" Failed ctor for std::locale with "en_US" Failed ctor for std::locale with "en_US.UTF-8" Failed ctor for std::locale with "pl_PL" Failed ctor for std::locale with "pl_PL.ISO8859-2" === END TERMINAL OUTPUT === _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... I forgot to print the e.what() message when the std::locale ctor throws an exception. I've updated the code in the link to do that. Here's the new output on my OS X machine; as expected, it just says that the locale name is invalid: Trying C++ locales... Succeeded ctor for std::locale with "C" Succeeded ctor for std::locale with "POSIX" Failed ctor for std::locale with "en_US": locale::facet::_S_create_c_locale name not valid Failed ctor for std::locale with "en_US.UTF-8": locale::facet::_S_create_c_locale name not valid Failed ctor for std::locale with "pl_PL": locale::facet::_S_create_c_locale name not valid Failed ctor for std::locale with "pl_PL.ISO8859-2": locale::facet::_S_create_c_locale name not valid === END TERMINAL OUTPUT === I'm currently studying how locales work in C/C++, I'm using OS X machine and a Linux machine for testing. I wrote the following test program to make sure that I can successfully initialize a few locales on both my systems: http://www.rutski89.com:31597/upload/test.cpp Running this on my linux machine I get exactly the output I expected, all success: However, when running on my OS X machine with the stock g++ (running on 10.5.1) I get the following: It seems that the system is only able to create C++ locales for "C" and "POSIX", which is puzzling, and also very unsatisfactory. It would be unhappy, but at least settling, if I found a page that said something like "C++ locales on OS X only support "C" and "POSIX", tough luck!". However, such a page is nowhere to be found, and in fact I have found evidence to the contrary. Searching "site:apple.com std::locale" in google brings up various pages where people describe issues with the usage of std::locale. However, these pages pertain to issues with the usage of the locale after it has already been created, which implies that the people who made the posts were actually able to create the locale to begin with; so why am I not able to create them? I've been banging my head against the wall for a while now; any help would be much appreciated -Patrick This email sent to site_archiver@lists.apple.com