[Seaside] Zinc-Seaside: Problem with POSTing UTF-8 JSON

Philippe Marschall philippe.marschall at gmail.com
Fri Jun 28 07:38:47 UTC 2013


On Thu, Jun 27, 2013 at 12:01 AM, Sven Van Caekenberghe <sven at stfx.eu> wrote:
> Hi Tomas,
>
> On 26 Jun 2013, at 22:46, Tomas Kukol <tomas.kukol at gmail.com> wrote:
>
>> Unbelievable, this code with Czech characters and MIME type set to text/json works well:
>>
>> GPRestfulHandler(WARestfulHandler)>>czechTestReal
>>       <get>
>>       <path: 'czechTestReal'>
>>       <produces: 'text/json; charset=utf-8'>
>>       ^ 'Czech is in Czech čeština.' asJson
>>
>> This code with Czech characters and MIME type set to application/json throws an error.
>>
>> GPRestfulHandler(WARestfulHandler)>>czechTestReal
>>       <get>
>>       <path: 'czechTestReal'>
>>       <produces: 'application/json; charset=utf-8'>
>>       ^ 'Czech is in Czech čeština.' asJson
>>
>> There is difference only in produces - text/json vs. application/json, but there are probably different stream - text vs. binary.
>
> Great that you found it !
>
> Indeed, consider:
>
> (WAMimeType fromString: 'text/json') isBinary. false
> (WAMimeType fromString: 'application/json') isBinary. true
>
> (ZnMimeType fromString: 'text/json') isBinary. false
> (ZnMimeType fromString: 'application/json') isBinary. false
>
> I made an explicit exception for application/json in ZnMimeType ;-)

Good find, I created a bug [1]

 [1] http://code.google.com/p/seaside/issues/detail?id=759

Cheers
Philippe


More information about the seaside mailing list