[squeak-dev] Re: [ANN] WebClient and WebServer 1.0 for Squeak

Andreas Raab andreas.raab at gmx.de
Fri May 7 03:43:47 UTC 2010


On 5/6/2010 3:32 PM, christophe.jalady at free.fr wrote:
> But it looks like there is a bug with the encoding !

The behavior you are seeing is intentional. WebClient doesn't interpret 
the content of a response. It simply gives you the bytes that you can 
deal with in any way you see fit. That includes dealing with encodings.

> I try to GET a document encoded as utf-8. The header of the response contain
> "content-type'->'text/html;charset=utf-8". But the characters are wrong.

They are UTF-8 encoded just as the content type implies.

> I have tried a quick test by replacing "ByteString" with "WideString" in
> WebResponse>>content without success.

Yes, you need to decode the input. You can for example use the method 
#utf8ToSqueak to decode the string into UTF-8.

> I will try to investigate more this week-end.

Good luck!

Cheers,
   - Andreas

>> On 5/5/2010 3:43 PM, christophe.jalady at free.fr wrote:
>>> Just a simple test under Squeak 4.1: Http GET with Basic Auth is working.
>>
>> Glad to see it works for you.
>>
>>> But I have trouble under Pharo:
>>> I have added to my Montecillo
>>> MCHttpRepository
>>>       location: 'http://www.squeaksource.com/WebClient'
>>> and I have tried to load the WebClient core package (version 15).
>>>
>>> A simple "Http GET" is not working. it fail trying to read the content
>>> (ByteString>>new:streamsContent: is not found)
>>>
>>> Do you plan to make your package "pharo compliant" ? (or maybe it should be
>>> Pharo wich become "WebClient compliant" ?)
>>
>> Well, either way :-) I've added a 'WebClient-Pharo' package with a bunch
>> of patches that will make WebClient work under Pharo 1.0 but I noticed
>> that one bug affecting SocketStream may indicate that some other bugs in
>> SocketStream are not fixed either. Unfortunately WebClient and WebServer
>> rely heavily on correct functioning of SocketStream and my test coverage
>> is not 100% so there may be undetected issues. If you find any, let me
>> know and I'll issue another patch (and increase test coverage along the
>> way :-)
>>
>>> By the way, thank you for your great work on this project !!
>>
>> You're very welcome.
>>
>> Cheers,
>>     - Andreas
>>
>>
>
>
>
>




More information about the Squeak-dev mailing list