[Zope] Show ISO-8859-7 Results in a site using UTF-8
Jens Vagelpohl
jens at dataflake.org
Fri Oct 14 04:38:39 EDT 2005
On 14 Oct 2005, at 09:14, Thomas G. Apostolou wrote:
> def GetData(self, sysDSN="aVoiSys", usr="sa", mypass="atsql2k",
> sTable="trdt", sFields="*"):
> id = self.id
> import dbi
> import odbc
> connection=odbc.odbc(sysDSN+'/'+usr+'/'+mypass)
> cur=connection.cursor()
> sSQL='Select '+sFields+' from '+sTable
> cur.execute(sSQL)
> data=cur.fetchall()
> cur.close()
> connection.close()
> return data
>
>
> Is there any way to return the "data" encoded in utf-8? It is
> coming as
> ISO-8859-7 from an SQL2K Server...
utf8_string = unicode(iso_8859_7_string, 'iso-8859-7').encode('utf-8')
jens
More information about the Zope
mailing list