From cb8777a69a189f2f6215eb177ccc7cf2715295ad Mon Sep 17 00:00:00 2001 From: John Ralls Date: Sun, 14 Dec 2025 13:38:20 -0800 Subject: [PATCH] Bug 799504 - Description of CAMT 053.001.02 has duplicate text --- gnucash/import-export/aqb/gnc-ab-utils.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/gnucash/import-export/aqb/gnc-ab-utils.c b/gnucash/import-export/aqb/gnc-ab-utils.c index e1b1d3a3d9..935468304d 100644 --- a/gnucash/import-export/aqb/gnc-ab-utils.c +++ b/gnucash/import-export/aqb/gnc-ab-utils.c @@ -325,16 +325,19 @@ join_ab_strings_cb (const gchar *str, gpointer user_data) if (!str || !*str) return NULL; - tmp = g_strdup (str); + tmp = g_utf8_normalize (str, -1, G_NORMALIZE_NFC); g_strstrip (tmp); gnc_utf8_strip_invalid_and_controls (tmp); if (*acc) { - gchar *join = g_strjoin (" ", *acc, tmp, (gchar*) NULL); - g_free (*acc); + if (!strstr (*acc, tmp)) + { + gchar *join = g_strjoin (" ", *acc, tmp, (gchar*) NULL); + g_free (*acc); + *acc = join; + } g_free (tmp); - *acc = join; } else { @@ -379,7 +382,7 @@ gnc_ab_get_purpose (const AB_TRANSACTION *ab_trans, gboolean is_ofx) * hence we put this text in front of the purpose. */ ab_transactionText = AB_Transaction_GetTransactionText (ab_trans); if (ab_transactionText && *ab_transactionText) - gnc_description = g_strdup (ab_transactionText); + gnc_description = g_utf8_normalize (ab_transactionText, -1, G_NORMALIZE_NFC); } ab_purpose = AB_Transaction_GetPurposeAsStringList (ab_trans);