r14754 - gnucash/branches/2.0 - Ensure the encoding of the ktoblzcheck library is used correctly.
Derek Atkins
warlord at cvs.gnucash.org
Mon Aug 28 23:26:55 EDT 2006
Author: warlord
Date: 2006-08-28 23:26:54 -0400 (Mon, 28 Aug 2006)
New Revision: 14754
Trac: http://svn.gnucash.org/trac/changeset/14754
Modified:
gnucash/branches/2.0/
gnucash/branches/2.0/ChangeLog
gnucash/branches/2.0/src/import-export/hbci/dialog-hbcitrans.c
Log:
Ensure the encoding of the ktoblzcheck library is used correctly.
Their encoding is still always ISO-8859-1, but in future versions
they might change it to something else. We're prepared now.
Merge from r14676.
Property changes on: gnucash/branches/2.0
___________________________________________________________________
Name: svk:merge
- d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/branches/2.0:13181
+ d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/branches/2.0:13182
Modified: gnucash/branches/2.0/ChangeLog
===================================================================
--- gnucash/branches/2.0/ChangeLog 2006-08-29 03:26:36 UTC (rev 14753)
+++ gnucash/branches/2.0/ChangeLog 2006-08-29 03:26:54 UTC (rev 14754)
@@ -5,6 +5,14 @@
* src/engine/Account.c: Add missing call to xaccAccountBeginEdit.
+2006-08-15 Christian Stimming <stimming at tuhh.de>
+
+ * src/import-export/hbci/dialog-hbcitrans.c (blz_changed_cb):
+ Ensure the encoding of the ktoblzcheck library is used
+ correctly. Their encoding is still always ISO-8859-1, but in
+ future versions they might change it to something else. We're
+ prepared now.
+
2006-08-15 David Hampton <hampton at employees.org>
* src/core-utils/gnc-gconf-utils.[ch]:
Modified: gnucash/branches/2.0/src/import-export/hbci/dialog-hbcitrans.c
===================================================================
--- gnucash/branches/2.0/src/import-export/hbci/dialog-hbcitrans.c 2006-08-29 03:26:36 UTC (rev 14753)
+++ gnucash/branches/2.0/src/import-export/hbci/dialog-hbcitrans.c 2006-08-29 03:26:54 UTC (rev 14754)
@@ -866,13 +866,26 @@
if (record) {
const char *bankname = AccountNumberCheck_Record_bankName (record);
GError *error = NULL;
+ const char *ktoblzcheck_encoding =
+#ifdef KTOBLZCHECK_VERSION_MAJOR
+ /* This version number macro has been added in
+ ktoblzcheck-1.10, but this function exists already since
+ ktoblzcheck-1.7, so we're on the safe side. */
+ AccountNumberCheck_stringEncoding()
+#else
+ /* Every ktoblzcheck release before 1.10 is guaranteed to
+ return strings only in ISO-8859-15. */
+ "ISO-8859-15"
+#endif
+ ;
gchar *utf8_bankname = g_convert (bankname, strlen(bankname),
- "UTF-8", "ISO-8859-15",
+ "UTF-8", ktoblzcheck_encoding,
NULL, NULL, &error);
if (error != NULL) {
- printf ("Error convertion bankname \"%s\" to UTF-8\n", bankname);
+ printf ("Error converting bankname \"%s\" to UTF-8\n", bankname);
g_error_free (error);
- utf8_bankname = g_strdup (bankname);
+ /* Conversion was erroneous, so don't use the string */
+ utf8_bankname = g_strdup (_("(unknown)"));
}
gtk_label_set_text (GTK_LABEL (td->recp_bankname_label),
(strlen(utf8_bankname)>0 ?
More information about the gnucash-changes
mailing list