Check for potentially failed utf8 conversion of locale strings. bug#383270

BP

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15204 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming 2006-12-11 22:28:36 +00:00
parent 0dcefd51f6
commit 9aa7ad31d2

View File

@ -734,6 +734,11 @@ gnc_lconv_set_utf8 (char **p_value, char *default_value)
*p_value = default_value;
*p_value = g_locale_to_utf8 (*p_value, -1, NULL, NULL, NULL);
if (*p_value == NULL) {
// The g_locale_to_utf8 conversion failed. FIXME: Should we rather
// use an empty string instead of the default_value? Not sure.
*p_value = default_value;
}
// FIXME: Do we really need to make a copy here ?
//*p_value = g_strdup (*p_value);
}