[Zope] Problems with unicode and other encodings.
ulrich.wisser at relevanttraffic.se
Wed Nov 17 05:26:32 EST 2004
as you discovered, character encodings can be a pain. Before I give any
advice, let us know some more about your application.
- Do your users use more then one language?
- Do your users use more then one encoding?
(Russian, Chinese, ... have several encodings for the same language.)
- Have you specified which encoding Zope should use when answering
- What database do you use?
- What is the default encoding for your database? What encoding is the
data stored in?
- Did you specify your client encoding for the database connection?
Usually a browser will send data back in the encoding the page
containing the form was encoded. So it would be a good idea to specify
the encoding in your page header. Please check your web server set up
too, sometimes the web server specifies the encoding in the http header.
Use Unicode strings in your scripts and don't return printed, return a
Unicode string. That will allow Zope to convert the string to the
desired encoding to answer a request.
Databases often will convert encodings too. From there storage to the
clients encoding and vice versa. Therefor it is important to specify
both correctly. If you use only one encoding try to use it everywhere,
even as database encoding. Otherwise it would be a good idea to use
UTF-8 as database encoding.
RELEVANT TRAFFIC SWEDEN AB, Riddarg 17A, SE-114 57 Sthlm, Sweden
Direct (+46)86789755 || Cell (+46)704467893 || Fax (+46)86789769
More information about the Zope