[Zope] Re: unicode and zope

Toby Dickenson tdickenson at geminidataloggers.com
Wed Feb 4 11:27:12 EST 2004


On Wednesday 04 February 2004 16:16, Andrew Altepeter wrote:

> field.encode('latin-1')
>
> Everything will work well? 

You will get an exception at that point if someone has typed a non-latin1 
string into your form. maybe thats what you want; handle the exception and 
report an error.

> Or, will these unicode characters just have
> 8 bits removed?

field.encode('latin-1','replace') will change characters that dont fit in 
latin-1 into the ? character.

-- 
Toby Dickenson




More information about the Zope mailing list