Prevent crashing due to unsupported locale settings

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23750 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
John Ralls 2014-01-23 22:16:40 +00:00
parent cbfb4ef1af
commit 5670f2b077

View File

@ -712,6 +712,15 @@ main(int argc, char ** argv)
set_mac_locale();
#endif
gnc_environment_setup();
#ifndef MAC_INTEGRATION /* setlocale already done */
if (!setlocale (LC_ALL, ""))
{
g_print ("The locale defined in the environment isn't supported. "
"Falling back to the 'C' (US English) locale\n");
g_setenv ("LC_ALL", "C", TRUE);
setlocale (LC_ALL, "C");
}
#endif
#ifdef HAVE_GETTEXT
{
gchar *localedir = gnc_path_get_localedir();