[Zope] Re: Zope iso-8859-1 to utf-8

Chris Withers chris at simplistix.co.uk
Fri Sep 23 16:44:17 EDT 2005


Also, watcha out for the gotcha in BaseResponse.py, which can end up 
doing a default encoding to latin-1 in some circumstances.

I really want to make that hard coded thing configurable in zope.conf at 
some stage...

Chris

Pascal Peregrina wrote:
> I see...  And what python function would you use for conversion ?
> 
> I made some tests and was surprised of the results... 
> I switched ZMI to UTF-8 (management_page_charset) and edited some of my
> documents / properties and all went fine.
> The generated documents are still sent to browsers as iso-8859-1, and are
> not broken.
> 
> So my question would be : which valid UTF-8 characters (for typical Western
> languages like English, French, Spanish, ...) would be invalid in iso-8859-1
> ?
> 
> Last thing, if ZMI is switched to UTF-8, then what is the difference between
> ustring/string, etc properties ?
> 
> Thanks.
> 
> Pascal
> 
> -----Message d'origine-----
> De : zope-bounces at zope.org [mailto:zope-bounces at zope.org]De la part de
> Max M
> Envoyé : mardi 13 septembre 2005 14:51
> À : zope at zope.org
> Objet : [Zope] Re: Zope iso-8859-1 to utf-8
> 
> 
> Pascal Peregrina wrote:
> 
>>Hi,
>> 
>>I have been running a Zope installation for 2 years, so there are now lots
>>of objects, properties, etc...
>> 
>>I would like to know what are the possible issues I may have to face if I
>>change the default encoding for iso-8859-1 to utf-8 in ZMI.
> 
> 
> You must write a script that converts any property on any object in your 
> site that is latin-1 to utf-8.
> 
> So first find all objects you use. See what types they are.
> 
> Find all text and string attributes on those opjects.
> 
> Write a function that converts from latin to utf and run that on every 
> object.
> 
> The hard part will be finding all the attributes, but perhaps you can 
> write a method that can help find those properties for you using 
> introspection.
> 
> 

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk


More information about the Zope mailing list