Iliad: inconsitent encodings?

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

Iliad: inconsitent encodings?

Stefan Schmiedl
So I finally managed to make my app maintain the gui in a nice ajax-based
way with only the tiniest amount of javascript code, thanks to nifty
jQuery selectors.

One thing is strange, though: I have a widget showing something related
to the current question and a few solutions to choose from (radio buttons).

Gerätetreiber    (*) weiß nicht  ( ) ja  ( ) nein

The first one (don't know) is selected by default. Now after clicking
on the second (yes), I get the following content:

Ger�tetreiber    ( ) wei� nicht  (*) ja  ( ) nein

I suspect that JSON based responses are passed along without going through
the same encoding steps as "normal" responses. I'm pretty sure that the
"normal" responses are converted somewhere, as I'm passing the text in
as ISO-8859-1 (well, actually win-1252) and the browser receives UTF-8,
JSON responses being the exception.

Nevertheless, it was a successful evening,
s.


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Iliad: inconsitent encodings?

Stefan Schmiedl
On Sat, 4 Jul 2009 02:01:54 +0200
Stefan Schmiedl <[hidden email]> wrote:

> Gerätetreiber    (*) weiß nicht  ( ) ja  ( ) nein
>
> Ger�tetreiber    ( ) wei� nicht  (*) ja  ( ) nein
>
> I suspect that JSON based responses are passed along without going
> through the same encoding steps as "normal" responses. I'm pretty
> sure that the "normal" responses are converted somewhere, as I'm
> passing the text in as ISO-8859-1 (well, actually win-1252) and the
> browser receives UTF-8, JSON responses being the exception.
>
> Nevertheless, it was a successful evening,

and it's starting out as a beautiful morning, too: A quick and probably
dirty hack to fix this behavior is letting GSTEncoder at the response:

stefan@g128 trunk $ svn diff
Index: Core/RequestHandlers/JsonHandler.st
===================================================================
--- Core/RequestHandlers/JsonHandler.st (revision 1379)
+++ Core/RequestHandlers/JsonHandler.st (working copy)
@@ -65,8 +65,8 @@
  scripts add: child]]].
     jsonContents at: 'widgets' put: widgets.
     jsonContents at: 'scripts' put: scripts.
-    response nextPutAll: (String streamContents: [:stream |
- jsonContents printJsonOn: stream]).
+    response nextPutAll: ( GSTEncoder encode: (String streamContents: [:stream |
+ jsonContents printJsonOn: stream]) ).
     self session
  clearDirtyWidgets;
  clearRedirectUrl]

s.


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Iliad: inconsitent encodings?

Nicolas Petton
Le samedi 04 juillet 2009 à 10:32 +0200, Stefan Schmiedl a écrit :

> On Sat, 4 Jul 2009 02:01:54 +0200
> Stefan Schmiedl <[hidden email]> wrote:
>
> > Gerätetreiber    (*) weiß nicht  ( ) ja  ( ) nein
> >
> > Ger�tetreiber    ( ) wei� nicht  (*) ja  ( ) nein
> >
> > I suspect that JSON based responses are passed along without going
> > through the same encoding steps as "normal" responses. I'm pretty
> > sure that the "normal" responses are converted somewhere, as I'm
> > passing the text in as ISO-8859-1 (well, actually win-1252) and the
> > browser receives UTF-8, JSON responses being the exception.
> >
> > Nevertheless, it was a successful evening,
>
> and it's starting out as a beautiful morning, too: A quick and probably
> dirty hack to fix this behavior is letting GSTEncoder at the response:
>
Hi Stefan,

I finally didn't include the patch, because the bug didn't come from
there, but from Iliad.Site. Please update and tell me if it works for
you too.

Cheers!

Nico

> stefan@g128 trunk $ svn diff
> Index: Core/RequestHandlers/JsonHandler.st
> ===================================================================
> --- Core/RequestHandlers/JsonHandler.st (revision 1379)
> +++ Core/RequestHandlers/JsonHandler.st (working copy)
> @@ -65,8 +65,8 @@
>   scripts add: child]]].
>      jsonContents at: 'widgets' put: widgets.
>      jsonContents at: 'scripts' put: scripts.
> -    response nextPutAll: (String streamContents: [:stream |
> - jsonContents printJsonOn: stream]).
> +    response nextPutAll: ( GSTEncoder encode: (String streamContents: [:stream |
> + jsonContents printJsonOn: stream]) ).
>      self session
>   clearDirtyWidgets;
>   clearRedirectUrl]
>
> s.
>
>
> _______________________________________________
> help-smalltalk mailing list
> [hidden email]
> http://lists.gnu.org/mailman/listinfo/help-smalltalk

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

signature.asc (204 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Iliad: inconsitent encodings?

Stefan Schmiedl
On Mon, 06 Jul 2009 01:01:44 +0200
Nicolas Petton <[hidden email]> wrote:

> Le samedi 04 juillet 2009 à 10:32 +0200, Stefan Schmiedl a écrit :
> > On Sat, 4 Jul 2009 02:01:54 +0200
> > Stefan Schmiedl <[hidden email]> wrote:
> >
> > > Gerätetreiber    (*) weiß nicht  ( ) ja  ( ) nein
> > >
> > > Ger�tetreiber    ( ) wei� nicht  (*) ja  ( ) nein
> > >
>
> I finally didn't include the patch, because the bug didn't come from
> there, but from Iliad.Site. Please update and tell me if it works for
> you too.
yes, it works. What was the problem in Site?

s.

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Iliad: inconsitent encodings?

Nicolas Petton
Le lundi 06 juillet 2009 à 01:24 +0200, Stefan Schmiedl a écrit :

> On Mon, 06 Jul 2009 01:01:44 +0200
> Nicolas Petton <[hidden email]> wrote:
>
> > Le samedi 04 juillet 2009 à 10:32 +0200, Stefan Schmiedl a écrit :
> > > On Sat, 4 Jul 2009 02:01:54 +0200
> > > Stefan Schmiedl <[hidden email]> wrote:
> > >
> > > > Gerätetreiber    (*) weiß nicht  ( ) ja  ( ) nein
> > > >
> > > > Ger�tetreiber    ( ) wei� nicht  (*) ja  ( ) nein
> > > >
> >
> > I finally didn't include the patch, because the bug didn't come from
> > there, but from Iliad.Site. Please update and tell me if it works for
> > you too.
>
> yes, it works. What was the problem in Site?
A stupid bug in the detection of binary content responses (those
responses are of course not encoded)

Cheers!

Nico

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

signature.asc (204 bytes) Download Attachment