DEBUG_TRACE(DEBUG::Locale,string_compose("LG: change C & C++ locale from '%1' => %2\n",old_cpp_locale.name(),pre_cpp_locale.name()));
}catch(...){
/* Apple in particular have historically done a
*terriblejobsupportingsetlocaleandevenmoreso
*withtheC++API.Usinganylocaleotherthan"C"or
*"POSIX"willfail,andinthecaseoftheC++API,
*willthrowanexception.Inthatcase,justtryto
*usesetlocale()toreset*only*thenumericaspect
*ofthecurrentlocalesettingsbackto"C",whichis
*likelytoworkeverywhere.
*/
setlocale(LC_NUMERIC,"C");
pre_cpp_locale=std::locale();
DEBUG_TRACE(DEBUG::Locale,string_compose("LG: C++ locale API failed, change just C locale from '%1' => 'C' (C++ locale is %2)\n",old_c_locale,pre_cpp_locale.name()));
PBD::warning<<string_compose("LocaleGuard: someone (a plugin) changed the C++ locale from\n\t%1\nto\n\t%2\n, expect non-portable session files. Decimal OK ? %2",
DEBUG_TRACE(DEBUG::Locale,string_compose("LG: restore C & C++ locale: '%1'\n",std::locale().name()));
}catch(...){
/* see comments in the constructor regarding the
*exception.
*
*Thisshouldrestorerestorenumerichandlingbackto
*thedefault(whichmayreflectuser
*preferences).Thisprobablycan'tfail,because
*old_c_localewasalreadyinuseduringthe
*constructorforthisobject.
*
*Still...Apple...localesupport...justsayin'....
*/
setlocale(LC_NUMERIC,old_c_locale);
DEBUG_TRACE(DEBUG::Locale,string_compose("LG: C++ locale API failed, restore C locale from %1 to\n'%2'\n(C++ is '%3')\n",current_c_locale,old_c_locale,std::locale().name()));
DEBUG_TRACE(DEBUG::Locale,string_compose("LG: restore C locale from %1 to\n'%2'\n(C++ is '%3')\n",current_c_locale,old_c_locale,std::locale().name()));