[Zope3-dev] unicode problems !?

Bjorn Tillenius bjoti777 at student.liu.se
Fri Oct 8 14:51:47 EDT 2004


On Fri, Oct 08, 2004 at 07:24:08AM -0400, Stephan Richter wrote:
> On Friday 08 October 2004 03:01, j.kartnaller wrote:
> > I create a file object in ZMI as text/plain.
> > Then I edit the content of the file and enter a german umlaut I get the
> > message 'Invalid textual data'.
> > This happens in 'zope.app.form.browser.textwidgets.py'
> 
> This also correct, since you type in Latin-1, where UTF-8 is expected. So you 
> would need to create a custom form that knows how to handle latin-1 encoded 
> strings.

No, that's not correct. Where is UTF-8 expected?
The problem is that the Bytes widget assumes that unicode strings only
contain ascii characters.

It's quite problematic to edit text files, since the user can upload the
files himself, and there's no way of knowing which encoding they use. I
can't see an easy fix to the problem, apart from removing the
possibility to edit files of course.

Regards,

Bjorn


More information about the Zope3-dev mailing list