[Q] WAKomEncoded equivalent thing for WAListener?

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

[Q] WAKomEncoded equivalent thing for WAListener?

Chun, Sungjin
Hi,

I've used WAKomEncoded for my web app, and found that my application
does not work with WAListener if there's Korean character in page/response.

As I said I've used WAKomEncoded and with this, my application works well :-)

The problem is that with WAKomEncoded, I can assume all my instances of string
is encoded as Squeak Native internal encoding and if I make my string conforms to
this, everything is OK. (Yes, I have to convert encoding from/to Squeak Native/UTF-8
when using external resources like Database, which uses UTF-8).

So, my question is that what part should I change to make WAKomEncoded equivalent
thing for WAListener, for processing input encoding, I can make it referring WAKom and
WAKomEncoded, but I cannot make proper conversion for output. My response string
looks like this

"   H   T   T   P      2   0   0    O   K..."

instead of

"HTTP 200 OK..."

if it contains korean(or any other multibyte encoding characters).

Thanks in advance.


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

Re: [Q] WAKomEncoded equivalent thing for WAListener?

Lukas Renggli
> I've used WAKomEncoded for my web app, and found that my application
> does not work with WAListener if there's Korean character in page/response.

Yes, this is a problem with the current (bad) design of the server
adaptors: automatic encoding is only supported in the WAKom hierarchy.
It would be probably better if we moved this encoding transformation
as a strategy into the request/response so that it can be reused with
any server adapter.

So far I was probably the only one using WAListener. As you maybe know
from earlier posts of mine, I don't trust the encoding of Squeak and
just keep all data in UTF-8 in my images.

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: [Q] WAKomEncoded equivalent thing for WAListener?

cbeler
Lukas Renggli a écrit :

>> I've used WAKomEncoded for my web app, and found that my application
>> does not work with WAListener if there's Korean character in page/response.
>>    
>
> Yes, this is a problem with the current (bad) design of the server
> adaptors: automatic encoding is only supported in the WAKom hierarchy.
> It would be probably better if we moved this encoding transformation
> as a strategy into the request/response so that it can be reused with
> any server adapter.
>  
Besides, this encoding problem, is WAListener a sort of classic WAKom
when not streaming and also a streaming adaptor when needed ? In other
word, could we use only WAListener (if no encoding stuff...) ? Is it
what you do ?

> So far I was probably the only one using WAListener. As you maybe know
> from earlier posts of mine, I don't trust the encoding of Squeak and
> just keep all data in UTF-8 in my images.
>
>  
What's the drawback of having UTF-8 data in the image ? you cannot
"change" them in squeak nor inspect ?

Thanks

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

Re: [Q] WAKomEncoded equivalent thing for WAListener?

Lukas Renggli
> >> I've used WAKomEncoded for my web app, and found that my application
> >> does not work with WAListener if there's Korean character in page/response.
> >
> > Yes, this is a problem with the current (bad) design of the server
> > adaptors: automatic encoding is only supported in the WAKom hierarchy.
> > It would be probably better if we moved this encoding transformation
> > as a strategy into the request/response so that it can be reused with
> > any server adapter.
> >
> Besides, this encoding problem, is WAListener a sort of classic WAKom
> when not streaming and also a streaming adaptor when needed ?

WAListener implements a minimal web server on its own. It uses the
request parsing of Kom though.

> In other
> word, could we use only WAListener (if no encoding stuff...) ? Is it
> what you do ?

WAKom is equivalent to WAListener. There are no equivalents for
WAKomEncoded, WAKomEncoded39 and WAKomEncodedSuperPlus ;-)

> > So far I was probably the only one using WAListener. As you maybe know
> > from earlier posts of mine, I don't trust the encoding of Squeak and
> > just keep all data in UTF-8 in my images.
> >
> What's the drawback of having UTF-8 data in the image ? you cannot
> "change" them in squeak nor inspect ?

In my experience this is usually not a problem. For example, #size
might not answer what you expect: it answers the bytes the string
consists of, not the number of actual characters. All the stream
methods, and #copyFrom:to:, #indexOf:, #findSubString:, #, etc. work
fine (for example all that is needed in the Pier parser). Data might
look scrambled in the inspectors, but you can easily convert it using
#utf8ToIso and #isoToUtf8.

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: [Q] WAKomEncoded equivalent thing for WAListener?

Philippe Marschall
2007/9/9, Lukas Renggli <[hidden email]>:

> > >> I've used WAKomEncoded for my web app, and found that my application
> > >> does not work with WAListener if there's Korean character in page/response.
> > >
> > > Yes, this is a problem with the current (bad) design of the server
> > > adaptors: automatic encoding is only supported in the WAKom hierarchy.
> > > It would be probably better if we moved this encoding transformation
> > > as a strategy into the request/response so that it can be reused with
> > > any server adapter.
> > >
> > Besides, this encoding problem, is WAListener a sort of classic WAKom
> > when not streaming and also a streaming adaptor when needed ?
>
> WAListener implements a minimal web server on its own. It uses the
> request parsing of Kom though.
>
> > In other
> > word, could we use only WAListener (if no encoding stuff...) ? Is it
> > what you do ?
>
> WAKom is equivalent to WAListener. There are no equivalents for
> WAKomEncoded, WAKomEncoded39 and WAKomEncodedSuperPlus ;-)
>
> > > So far I was probably the only one using WAListener. As you maybe know
> > > from earlier posts of mine, I don't trust the encoding of Squeak and
> > > just keep all data in UTF-8 in my images.
> > >
> > What's the drawback of having UTF-8 data in the image ? you cannot
> > "change" them in squeak nor inspect ?
>
> In my experience this is usually not a problem. For example, #size
> might not answer what you expect: it answers the bytes the string
> consists of, not the number of actual characters. All the stream
> methods, and #copyFrom:to:, #indexOf:, #findSubString:, #, etc. work
> fine (for example all that is needed in the Pier parser). Data might
> look scrambled in the inspectors,

This is also the case for WideStrings because they miss language tags.

Cheers
Philippe

> but you can easily convert it using
> #utf8ToIso and #isoToUtf8.
>
> Cheers,
> Lukas
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: [Q] WAKomEncoded equivalent thing for WAListener?

Philippe Marschall
In reply to this post by Lukas Renggli
2007/9/9, Lukas Renggli <[hidden email]>:

> > >> I've used WAKomEncoded for my web app, and found that my application
> > >> does not work with WAListener if there's Korean character in page/response.
> > >
> > > Yes, this is a problem with the current (bad) design of the server
> > > adaptors: automatic encoding is only supported in the WAKom hierarchy.
> > > It would be probably better if we moved this encoding transformation
> > > as a strategy into the request/response so that it can be reused with
> > > any server adapter.
> > >
> > Besides, this encoding problem, is WAListener a sort of classic WAKom
> > when not streaming and also a streaming adaptor when needed ?
>
> WAListener implements a minimal web server on its own. It uses the
> request parsing of Kom though.
>
> > In other
> > word, could we use only WAListener (if no encoding stuff...) ? Is it
> > what you do ?
>
> WAKom is equivalent to WAListener.

There was once one. ;-)

>There are no equivalents for
> WAKomEncoded, WAKomEncoded39 and WAKomEncodedSuperPlus ;-)
>
> > > So far I was probably the only one using WAListener. As you maybe know
> > > from earlier posts of mine, I don't trust the encoding of Squeak and
> > > just keep all data in UTF-8 in my images.
> > >
> > What's the drawback of having UTF-8 data in the image ? you cannot
> > "change" them in squeak nor inspect ?
>
> In my experience this is usually not a problem. For example, #size
> might not answer what you expect: it answers the bytes the string
> consists of, not the number of actual characters.

And anything that includes upper/lower case and whitespaces (outside
ASCII) does not work.

> All the stream
> methods, and #copyFrom:to:, #indexOf:, #findSubString:, #, etc. work
> fine

Only for ASCII strings/characters of course.

> (for example all that is needed in the Pier parser). Data might
> look scrambled in the inspectors, but you can easily convert it using
> #utf8ToIso and #isoToUtf8.

Only for Latin1 strings of course.

Cheers
Philippe


> Cheers,
> Lukas
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside