Index: src/import-export/hbci/druid-hbci-initial.c
===================================================================
--- src/import-export/hbci/druid-hbci-initial.c	(revision 14675)
+++ src/import-export/hbci/druid-hbci-initial.c	(working copy)
@@ -117,21 +117,25 @@
 
 static gchar *gnc_hbci_account_longname(const AB_ACCOUNT *hacc)
 {
-  const char *bankname;
+  gchar *bankname;
+  gchar *result;
   const char *bankcode;
   g_assert(hacc);
-  bankname = AB_Account_GetBankName (hacc);
+  bankname = 
+    gnc_hbci_utf8_strip_invalid_strdup (AB_Account_GetBankName (hacc));
   bankcode = AB_Account_GetBankCode (hacc);
   /* Translators: Strings are 1. Account code, 2. Bank name, 3. Bank code. */
-  if (bankname)
-    return g_strdup_printf(_("%s at %s (code %s)"),
+  if (strlen(bankname) > 0)
+    result = g_strdup_printf(_("%s at %s (code %s)"),
 			   AB_Account_GetAccountNumber (hacc),
 			   bankname,
 			   bankcode);
   else
-    return g_strdup_printf(_("%s at bank code %s"),
+    result = g_strdup_printf(_("%s at bank code %s"),
 			   AB_Account_GetAccountNumber (hacc),
 			   bankcode);
+  g_free (bankname);
+  return result;
 }
 
 
Index: src/import-export/hbci/gnc-hbci-utils.c
===================================================================
--- src/import-export/hbci/gnc-hbci-utils.c	(revision 14675)
+++ src/import-export/hbci/gnc-hbci-utils.c	(working copy)
@@ -609,6 +609,13 @@
   return g_strdup(tmp);
 }
 
+gchar *gnc_hbci_utf8_strip_invalid_strdup(const gchar* dubious_string)
+{
+  gchar *result = g_strdup (dubious_string);
+  gnc_utf8_strip_invalid (result);
+  return result;
+}
+
 /* Note: In the gnome2-branch we don't need the iconv(3) conversion
    and gnc_call_iconv() anymore since the gnc_book has an UTF-8
    encoding and the AqBanking library also expects all strings in
Index: src/import-export/hbci/dialog-hbcitrans.c
===================================================================
--- src/import-export/hbci/dialog-hbcitrans.c	(revision 14676)
+++ src/import-export/hbci/dialog-hbcitrans.c	(working copy)
@@ -246,7 +246,7 @@
 		GList *templates)
 {
   GladeXML *xml;
-  const char *hbci_bankid, *hbci_bankname;
+  const char *hbci_bankid;
   HBCITransDialog *td;
   GtkTreeSelection *selection;
   GtkTreeViewColumn *column;
@@ -258,7 +258,6 @@
   td->trans_type = trans_type;
   g_assert (h_acc);
   hbci_bankid = AB_Account_GetBankCode(h_acc);
-  hbci_bankname = AB_Account_GetBankName(h_acc);
 #if HAVE_KTOBLZCHECK_H
   td->blzcheck = AccountNumberCheck_new();
 #endif
@@ -272,6 +271,7 @@
 				  GTK_WINDOW (parent));
   
   {
+    gchar *hbci_bankname, *hbci_ownername;
     GtkWidget *heading_label;
     GtkWidget *recp_name_heading;
     GtkWidget *recp_account_heading;
@@ -394,9 +394,16 @@
     /* Make this button insensitive since it's still unimplemented. */
     gtk_widget_destroy (exec_later_button);
     
+    /* aqbanking up to 2.3.0 did not guarantee the following strings
+       to be correct utf8; bug#351371 */
+    hbci_bankname = 
+      gnc_hbci_utf8_strip_invalid_strdup (AB_Account_GetBankName(h_acc));
+    hbci_ownername = 
+      gnc_hbci_utf8_strip_invalid_strdup (AB_Account_GetOwnerName(h_acc));
+
     /* Fill in the values from the objects */
     gtk_label_set_text (GTK_LABEL (orig_name_label), 
-			AB_Account_GetOwnerName (h_acc));
+			hbci_ownername);
     gtk_label_set_text (GTK_LABEL (orig_account_label), 
 			AB_Account_GetAccountNumber (h_acc));
     gtk_label_set_text (GTK_LABEL (orig_bankname_label), 
@@ -405,6 +412,8 @@
 			 _("(unknown)")));
     gtk_label_set_text (GTK_LABEL (orig_bankcode_label), 
 			hbci_bankid);
+    g_free (hbci_ownername);
+    g_free (hbci_bankname);
 
     /* fill list for choosing a transaction template */
      gtk_tree_view_set_headers_visible(td->template_gtktreeview, FALSE);
Index: src/import-export/hbci/gnc-hbci-utils.h
===================================================================
--- src/import-export/hbci/gnc-hbci-utils.h	(revision 14675)
+++ src/import-export/hbci/gnc-hbci-utils.h	(working copy)
@@ -151,6 +151,12 @@
 /** Return a newly allocated string. */
 char *gnc_AB_VALUE_toReadableString(const AB_VALUE *v);
 
+/** Returns a newly allocated copy of the given string that is
+    also passed through gnc_utf8_strip_invalid() before
+    returned. As usual, the newly allocated string has to be
+    g_free'd by the caller. */
+gchar *gnc_hbci_utf8_strip_invalid_strdup(const gchar* dubious_string);
+
 /** Returns a newly allocated gchar, converted according to the given
    handler */
 gchar *gnc_call_iconv(GIConv handler, const gchar* input);
