Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: DB

Unicode charset problems dealing with the ZmySQLDA product

 

 

Zope db RSS feed   Index | Next | Previous | View Threaded


miguel.sanchez at iavante

Apr 30, 2007, 3:33 AM

Post #1 of 3 (1019 views)
Permalink
Unicode charset problems dealing with the ZmySQLDA product

Hello. I'm dealing with the ZmySQLDA product on Zope 2.9.7 and Python
2.4.3 versions.
I'm having problems when I retrieve data from the database because the
data is not rendered using the unicode charset when the zope instance is
in a vserver (with a Gentoo Linux distribution), so I get weird
characters like 'á' instead of the usual ones: 'á' (as they are strored
inthe db). This is not happening on my local machine, so I guess it
could be a bad configuration of the vserver.
Is there any possibilities to pass a parameter to the ZmySQLDSA
connection to make it use the unicode charset?
Which differences are between the _mysql python module and the MySQLdb
library for this purpose?
Could it be the configuation of the vserver? How can it be relationed
with the unicode problems?
Any idea?

Thanks!!
_______________________________________________
Zope-DB mailing list
Zope-DB[at]zope.org
http://mail.zope.org/mailman/listinfo/zope-db


charlie at egenix

Apr 30, 2007, 4:13 AM

Post #2 of 3 (941 views)
Permalink
Re: Unicode charset problems dealing with the ZmySQLDA product [In reply to]

Am 30.04.2007, 12:33 Uhr, schrieb Miguel Sánchez Beato
<miguel.sanchez[at]iavante.es>:

> Hello. I'm dealing with the ZmySQLDA product on Zope 2.9.7 and Python
> 2.4.3 versions.
> I'm having problems when I retrieve data from the database because the
> data is not rendered using the unicode charset when the zope instance is
> in a vserver (with a Gentoo Linux distribution), so I get weird
> characters like 'á' instead of the usual ones: 'á' (as they are strored
> inthe db). This is not happening on my local machine, so I guess it
> could be a bad configuration of the vserver.
> Is there any possibilities to pass a parameter to the ZmySQLDSA
> connection to make it use the unicode charset?
> Which differences are between the _mysql python module and the MySQLdb
> library for this purpose?
> Could it be the configuation of the vserver? How can it be relationed
> with the unicode problems?
> Any idea?

What setting do you have for Zope's encoding? in etc/zope.conf
Your problem might be solved with the correct setting for that. Otherwise
you may need to patch the DA to handle encoding for your target for you.

Charlie

--
Charlie Clark
eGenix.com

Professional Python Services directly from the Source
>>> Python/Zope Consulting and Support ... http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
________________________________________________________________________

:::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! ::::

eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
Registered at Amtsgericht Duesseldorf: HRB 46611
_______________________________________________
Zope-DB mailing list
Zope-DB[at]zope.org
http://mail.zope.org/mailman/listinfo/zope-db


dieter at handshake

Apr 30, 2007, 9:30 AM

Post #3 of 3 (934 views)
Permalink
Re: Unicode charset problems dealing with the ZmySQLDA product [In reply to]

Miguel Sánchez Beato wrote at 2007-4-30 12:33 +0200:
>I'm having problems when I retrieve data from the database because the
>data is not rendered using the unicode charset when the zope instance is
>in a vserver (with a Gentoo Linux distribution), so I get weird
>characters like 'á' instead of the usual ones: 'á' (as they are strored
>inthe db).

Strictly speaking, there is no "Unicode charset".

Apparently something in your data flow uses the "utf-8" charset
but your pages do not tell this to the browser.

You may try to set an
"response.setHeader('Content-Type', 'text/html; charset=utf-8)".

> ...
>Which differences are between the _mysql python module and the MySQLdb
>library for this purpose?
>Could it be the configuation of the vserver? How can it be relationed
>with the unicode problems?

Often the database configuration or some environment variable
determine the so called client encoding. The client encoding
controls which encoding (aka "charset") the client expects for
unicode strings.

There may be differences between your two configurations.



--
Dieter
_______________________________________________
Zope-DB mailing list
Zope-DB[at]zope.org
http://mail.zope.org/mailman/listinfo/zope-db

Zope db RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.