From d266bdd91e374d07d46491749ae1341a74db3eec Mon Sep 17 00:00:00 2001
From: Yoshinori Okuji <yo@nexedi.com>
Date: Thu, 26 Aug 2004 14:25:33 +0000
Subject: [PATCH] Convert a search pattern to unicode because the user can
 input utf-8.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1440 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Form/ListBox.py | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/product/ERP5Form/ListBox.py b/product/ERP5Form/ListBox.py
index fa39dc756e..c74aa0299c 100755
--- a/product/ERP5Form/ListBox.py
+++ b/product/ERP5Form/ListBox.py
@@ -1156,11 +1156,15 @@ onChange="submitAction(this.form,'%s/portal_selections/setReportRoot')">
 
           for cname in extended_columns:
             if cname[0] in search_columns_id_list:
-              list_search = list_search + (
-                "<td class=\"DataB\"><font size=\"-3\"> \
-                  <input name=\"%s\" size= \"8\" value=\"%s\" > \
-                  </font></td>\n" % \
-                     (str(cname[2]) , params.get(str(cname[2]),'')))
+              alias = str(cname[2])
+              param = params.get(alias,'')
+              if type(param) == type(''):
+                param = unicode(param, 'utf-8')
+              list_search += """\
+     <td class="DataB">
+       <font size="-3"><input name="%s" size="8" value="%s"></font>
+     </td>
+""" % (alias, param)
             else:
               list_search = list_search + (
                 "<td class=\"DataB\"></td> ")
-- 
2.30.9