[Seaside] Re: File upload - encoding issue

Philippe Marschall philippe.marschall at gmail.com
Thu Oct 9 18:31:51 UTC 2014


On Thu, Oct 9, 2014 at 9:30 AM, Sven Van Caekenberghe <sven at stfx.eu> wrote:
>
> On 09 Oct 2014, at 08:46, Dave <lasmiste at gmail.com> wrote:
>
>> Sven Van Caekenberghe-2 wrote
>>>> Do you have information in the request header that suggests UTF-8?
>>>
>>> Not that I can see, there are no charset=utf-8 anywhere (but one could
>>> assume they are the default):
>>
>> Right, I also can't find where utf-8 is set. Any idea on how can I change
>> the charset?
>
> Well, there is an accept-charset="utf-8" in the form, but it does not appear in the submitted form (I only checked one browser). Like I said, I need an informed opinion to help me make a decision here.

The codec on the server adaptor should do the trick. It should match
the page encoding and the accept-charset. Seaside always sets them to
the same value, I did not test which takes precedence in which
browser. I did a quick test and could verify it with UTF-8 and
ISO-8859-1 on Firefox. You can either use the codec on the server
adaptor or ask the codec for the name and do it with the Zinc
adaptors.

Weird things happen in ISO-8859-1 when using code points that do not
fit. Eg Mac OS X uses NFD so German umlauts are two code points with
the second one outside of ISO-8859-1. I did not test UTF-16 or
Shift_JIS.

Cheers
Philippe


More information about the seaside mailing list