[OGo-Developer] multipart/form-data and text encoding

Stéphane Corthésy developer@opengroupware.org
Thu, 23 Aug 2007 21:59:03 +0200


On Aug 23, 2007, at 9:30 PM, Helge Hess wrote:

> On 23.08.2007, at 21:26, Stéphane Corthésy wrote:
>> As I understand it, if my form has accept-charset="utf-8", then  
>> the client has to return form data encoded in UTF-8 - not  
>> ISOLatin1, nor any other encoding. Thus, on the server-side, you  
>> can safely decode form data from UTF-8. Isn't it what's happening?
>
> Yes, but how does SOPE know that the previous transaction was in  
> UTF-8 if the client doesn't transfer that information in the  
> content-type? Those are two separate HTTP transactions.


Server sets the accept-charset attribute, so, when it receives the  
form's submission, it should also now which accept-charset had been  
set before. The easiest case, for developer, is to always set accept- 
charset to the same value, and to invoke -[WORequest  
setDefaultFormValueEncoding:] (with formValueEncodingDetectionEnabled  
set to NO). That's what I did, IIRC.

Stéphane


> As mentioned we could add a special WOFormCharset form value (like  
> Google does), or we could let the WOApplication decide if it knows  
> that it always generates UTF-8 (which I think is what Wolfgang's  
> patch does).
>
> Thanks,
>   Helge
> -- 
> Helge Hess
> http://www.helgehess.eu/
>
>
> --
> OpenGroupware.org Developer
> developer@opengroupware.org
> http://mail.opengroupware.org/mailman/listinfo/developer