[Zope3-dev] Re: unicode problems !?
Philipp von Weitershausen
philipp at weitershausen.de
Sat Oct 9 05:42:53 EDT 2004
Bjorn Tillenius wrote:
> 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.
Files could grow an 'encoding' attribute that is updated by the editing
view according to the encoding of the request.
I think text/* files should still be editable; we should fix up the
Bytes widget.
Philipp
More information about the Zope3-dev
mailing list