[Gnucash-changes] Didier Vital's patch to solve pango warnings with
non UTF-8 locales
Neil Williams
codehelp at cvs.gnucash.org
Thu Oct 20 10:49:19 EDT 2005
Log Message:
-----------
Didier Vital's patch to solve pango warnings with non UTF-8 locales
Tags:
----
gnucash-gnome2-dev
Modified Files:
--------------
gnucash/src/app-utils:
gnc-ui-util.c
Revision Data
-------------
Index: gnc-ui-util.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/app-utils/gnc-ui-util.c,v
retrieving revision 1.39.2.15
retrieving revision 1.39.2.16
diff -Lsrc/app-utils/gnc-ui-util.c -Lsrc/app-utils/gnc-ui-util.c -u -r1.39.2.15 -r1.39.2.16
--- src/app-utils/gnc-ui-util.c
+++ src/app-utils/gnc-ui-util.c
@@ -710,14 +710,16 @@
}
static void
-gnc_lconv_set (char **p_value, char *default_value)
+gnc_lconv_set_utf8 (char **p_value, char *default_value)
{
char *value = *p_value;
if ((value == NULL) || (value[0] == 0))
*p_value = default_value;
- *p_value = g_strdup (*p_value);
+ *p_value = g_locale_to_utf8 (*p_value, -1, NULL, NULL, NULL);
+ // FIXME: Do we really need to make a copy here ?
+ //*p_value = g_strdup (*p_value);
}
static void
@@ -738,15 +740,15 @@
lc = *localeconv();
- gnc_lconv_set(&lc.decimal_point, ".");
- gnc_lconv_set(&lc.thousands_sep, ",");
- gnc_lconv_set(&lc.grouping, "\003");
- gnc_lconv_set(&lc.int_curr_symbol, "USD ");
- gnc_lconv_set(&lc.currency_symbol, "$");
- gnc_lconv_set(&lc.mon_decimal_point, ".");
- gnc_lconv_set(&lc.mon_thousands_sep, ",");
- gnc_lconv_set(&lc.mon_grouping, "\003");
- gnc_lconv_set(&lc.negative_sign, "-");
+ gnc_lconv_set_utf8(&lc.decimal_point, ".");
+ gnc_lconv_set_utf8(&lc.thousands_sep, ",");
+ gnc_lconv_set_utf8(&lc.grouping, "\003");
+ gnc_lconv_set_utf8(&lc.int_curr_symbol, "USD ");
+ gnc_lconv_set_utf8(&lc.currency_symbol, "$");
+ gnc_lconv_set_utf8(&lc.mon_decimal_point, ".");
+ gnc_lconv_set_utf8(&lc.mon_thousands_sep, ",");
+ gnc_lconv_set_utf8(&lc.mon_grouping, "\003");
+ gnc_lconv_set_utf8(&lc.negative_sign, "-");
gnc_lconv_set_char(&lc.frac_digits, 2);
gnc_lconv_set_char(&lc.int_frac_digits, 2);
More information about the gnucash-changes
mailing list