Accent encoding problem with seaside and scriptaculous

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Accent encoding problem with seaside and scriptaculous

Florian Minjat
Hi,
   I spent two hours yesterday to figure that out.
   I have a form with an ajax button (scriptaculous) which trigger the
form when clicked. But if I have some accented or special characters
in the input fields of the from, they are stored with errors.
   At first I tought it was
HTTPRequest>>decodeUrlEncodedForm:multipleValues: and
String>>unescapePercents which were broken. Then that it's the
scriptaculous script which is guilty.
   This bug is pretty obvious to test, at least on my squeak
(seaside2.6b1-mb.127 Scriptaculous-lr.162) : juste use the form part
of the scriptaculous example. If you input 'forêt' you get a
forêt in seaside. The POST variable value transmitted to seaside is
'for%C3%AAt'. But the URL-encode value for the character 'ê' should be
'%ea'.
   But I tried this example on scriptaculous.seasidehosting.st, and it
is displayed well with the same post value. So the guilty should be
seaside or Kom.
   Anyone as an idea how to make seaside understand the percented
values the way it should ?

Florian
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Accent encoding problem with seaside and scriptaculous

Philippe Marschall
2006/12/18, Florian Minjat <[hidden email]>:

> Hi,
>    I spent two hours yesterday to figure that out.
>    I have a form with an ajax button (scriptaculous) which trigger the
> form when clicked. But if I have some accented or special characters
> in the input fields of the from, they are stored with errors.
>    At first I tought it was
> HTTPRequest>>decodeUrlEncodedForm:multipleValues: and
> String>>unescapePercents which were broken. Then that it's the
> scriptaculous script which is guilty.
>    This bug is pretty obvious to test, at least on my squeak
> (seaside2.6b1-mb.127 Scriptaculous-lr.162) : juste use the form part
> of the scriptaculous example. If you input 'forêt' you get a
> forêt in seaside. The POST variable value transmitted to seaside is
> 'for%C3%AAt'. But the URL-encode value for the character 'ê' should be
> '%ea'.
>    But I tried this example on scriptaculous.seasidehosting.st, and it
> is displayed well with the same post value. So the guilty should be
> seaside or Kom.
>    Anyone as an idea how to make seaside understand the percented
> values the way it should ?
They work unless you have some combination that doesn't work
- Squeak version
- Kom adaper (WAKom/WAKomEncoded/WAKomEncoded39)
- Client encoding
- desired String class (WideString, (utf-8) ByteString)
please

Philippe

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Accent encoding problem with seaside and scriptaculous

Florian Minjat
Philippe Marschall wrote:

> 2006/12/18, Florian Minjat <[hidden email]>:
>> Hi,
>>    I spent two hours yesterday to figure that out.
>>    I have a form with an ajax button (scriptaculous) which trigger the
>> form when clicked. But if I have some accented or special characters
>> in the input fields of the from, they are stored with errors.
>>    At first I tought it was
>> HTTPRequest>>decodeUrlEncodedForm:multipleValues: and
>> String>>unescapePercents which were broken. Then that it's the
>> scriptaculous script which is guilty.
>>    This bug is pretty obvious to test, at least on my squeak
>> (seaside2.6b1-mb.127 Scriptaculous-lr.162) : juste use the form part
>> of the scriptaculous example. If you input 'forêt' you get a
>> forêt in seaside. The POST variable value transmitted to seaside is
>> 'for%C3%AAt'. But the URL-encode value for the character 'ê' should be
>> '%ea'.
>>    But I tried this example on scriptaculous.seasidehosting.st, and it
>> is displayed well with the same post value. So the guilty should be
>> seaside or Kom.
>>    Anyone as an idea how to make seaside understand the percented
>> values the way it should ?
>
> They work unless you have some combination that doesn't work
> - Squeak version

I made a squeak/seaside/scriptaculous image based on Squeak3.8.1a-6666.

> - Kom adaper (WAKom/WAKomEncoded/WAKomEncoded39)

Thoses classes are present in my image. I use KomHttpServer-gk.14 and
KomServices-gk.3. Should I use WAKomEncoded instead of WAKom ? How
should I do ? By using 'WAKomEncoded startOn: 9090' to start seaside ?

> - Client encoding

I specified the use of the charset 'ISO-8859-1' in WAHtmlRoot>>charSet
and WAResponse>>defaultValueForContentType. The header of the
scriptaculous post with the percented values says 'Content-Type:
text/html; charset=ISO-8859-1'.

> - desired String class (WideString, (utf-8) ByteString)

What should I do with theses String ? They are present in my image.

Florian
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Re: Accent encoding problem with seaside and scriptaculous

Lukas Renggli
The first question you have to ask is if the
scriptaculous.seasidehosting.st example works in your image?

     http://localhost:8080/seaside/scriptaculous

Conceptually this is the same as running all the SUnit tests after
loading a libaray. Can you reproduce the encoding problem there? In my
image it does work with WAKom and the default encoding.

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Accent encoding problem with seaside and scriptaculous

Florian Minjat
Yes I said the encoding problem could be shown on the scriptaculous
example too.
I solved my problem by upgrading to 3.9 and making a new fresh clean
image.

Thanks anyway !

Florian

Lukas Renggli wrote:

> The first question you have to ask is if the
> scriptaculous.seasidehosting.st example works in your image?
>
>     http://localhost:8080/seaside/scriptaculous
>
> Conceptually this is the same as running all the SUnit tests after
> loading a libaray. Can you reproduce the encoding problem there? In my
> image it does work with WAKom and the default encoding.
>
> Cheers,
> Lukas
>
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Accent encoding problem with seaside and scriptaculous

Florian Minjat
I tried both WAKom and WAKomEncoded in my 3.8 version.
I changed the default charset to 'ISO-8859-1' in WAHtmlRoot>>charSet
and WAResponse>>defaultValueForContentType in order to display the
accents.
When I used WAKom, the accents were well displayed, but scriptaculous
triggered values were not.
If I use WAKomEncoded, all the special characters on my seaside
application are not well displayed, normal text and scriptaculous
triggered values.
The bug could come from the changes in the default charset.
The new clean version of seaside works perfectly.

Florian

Lukas Renggli wrote:

>> Yes I said the encoding problem could be shown on the scriptaculous
>> example too. I solved my problem by upgrading to 3.9 and making a new
>> fresh clean image.
>
> Sorry, I didn't properly read your e-mail.
>
> I don't see the difference between 3.8 and 3.9. Did you use any of the
> WAKomEncoded servers in 3.8?
>
> Lukas
>
> --Lukas Renggli
> http://www.lukas-renggli.ch
>
>
>
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside