Fix currency display in locale with non utf8 charset

Christian Stimming stimming at tuhh.de
Thu Oct 20 05:19:02 EDT 2005


Hi,

Didier Vidal schrieb:
> This should fix one of the problems that Neil reported in en_GB locale.
> Do you see other pango-related problems, Neil ?

it's great that this fixes the pango problems. However --

>    if ((value == NULL) || (value[0] == 0))
>      *p_value = default_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);
>  }

-- IMHO the g_strdup shouldn't be used here, because g_locale_to_utf8 
returns a "gchar*" which IMHO means that this is an already newly 
allocated string. Unfortunately the documentation of g_locale_to_utf8 
doesn't clearly say this, but since it isn't a "const gchar*" I could 
only guess that the returned string is already newly allocated. So the 
g_strdup line should simply be removed.

Christian


More information about the gnucash-patches mailing list