mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
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:
parent
0dcefd51f6
commit
9aa7ad31d2
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user