r15280 - gnucash/branches/2.0 - Check for potentially failed utf8 conversion of locale strings. bug#383270

Derek Atkins warlord at cvs.gnucash.org
Sat Dec 30 14:44:45 EST 2006


Author: warlord
Date: 2006-12-30 14:44:44 -0500 (Sat, 30 Dec 2006)
New Revision: 15280
Trac: http://svn.gnucash.org/trac/changeset/15280

Modified:
   gnucash/branches/2.0/
   gnucash/branches/2.0/ChangeLog
   gnucash/branches/2.0/src/app-utils/gnc-ui-util.c
Log:
Check for potentially failed utf8 conversion of locale strings. bug#383270

Merge from r15204



Property changes on: gnucash/branches/2.0
___________________________________________________________________
Name: svk:merge
   - 3889ce50-311e-0410-a464-f059747ec5d1:/local/gnucash/branches/2.0:697
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/branches/2.0:13797
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/trunk:13282
   + 3889ce50-311e-0410-a464-f059747ec5d1:/local/gnucash/branches/2.0:697
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/branches/2.0:13798
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/trunk:13282

Modified: gnucash/branches/2.0/ChangeLog
===================================================================
--- gnucash/branches/2.0/ChangeLog	2006-12-30 19:44:17 UTC (rev 15279)
+++ gnucash/branches/2.0/ChangeLog	2006-12-30 19:44:44 UTC (rev 15280)
@@ -1,3 +1,8 @@
+2006-12-30  Christian Stimming  <stimming at tuhh.de>
+
+	* Check for potentially failed utf8 conversion of locale strings.
+	  bug#383270
+
 2006-12-30  Chris Shoemaker <chris.shoemaker at cox.net>
 
 	* Return zero instead of failing an assertion when the register

Modified: gnucash/branches/2.0/src/app-utils/gnc-ui-util.c
===================================================================
--- gnucash/branches/2.0/src/app-utils/gnc-ui-util.c	2006-12-30 19:44:17 UTC (rev 15279)
+++ gnucash/branches/2.0/src/app-utils/gnc-ui-util.c	2006-12-30 19:44:44 UTC (rev 15280)
@@ -741,6 +741,11 @@
     *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);
 }



More information about the gnucash-changes mailing list