[Cuis] WebClient and Unicode

H. Hirzel hannes.hirzel at gmail.com
Tue Feb 5 09:24:21 CST 2013


Thank you for the list. This makes things easier. So easy things first:

In

send400Response
	"Send a 400 bad request response"

	| message |
	message := '<html><head><title>400 Bad Request</title></head><body>',
		'<h1>Bad Request</h1>
		<p>The server encountered a request it did not understand.
		</body></html>'.
	
	self sendResponseCode: 400
		content: message squeakToUtf8
		type: 'text/plain; charset=utf-8'
		close: true



    message squeakToUtf8
can safely be replaced with

   message


No call to #squeakToUtf8. The message is an ASCII only string and
ASCII is compatible with UTF8. I.e. every ASCII file (lower ASCII, up
to code 127) is automatically a UFT8 file.

--Hannes

On 2/5/13, Germán Arduino <garduino at gmail.com> wrote:
> Hi Hannes:
>
> I was just responding the other mail where you mentioned me.
>
> Some methods where WebClient call UTF8TextConverter or squeakToUtf8 are:
>
> WebRequest >>send200Response:
> WebRequest >>send400Response
> WebRequest >>send404Response:
> WebRequest >>send500Response:
> WebSocket00>>send:type:
> WebSocket07>>firstFragment:
> Websocket07>>lastFragment:
> Websocket07>>nextFragment:
> WebSocket07>>send:
> WebClientServerTests>>testStrings
>
> Cheers.
> Germán.
>
> 2013/2/5 H. Hirzel <hannes.hirzel at gmail.com>:
>> On 2/1/13, Germán Arduino <garduino at gmail.com> wrote:
>>> Thanks Hannes, this is very useful to me.
>>>
>>> My next step in porting stuff is polish WebClient and, between other
>>> things, Unicode is an issue.
>>>
>>> Germán.
>>
>> Hello Germán
>>
>> May I ask you to give some indication where Unicode is used in
>> WebClient. I'd like to have a look at it and focus on that for the
>> Unicoed porting layer.
>>
>> Regards
>> Hannes
>>
>> _______________________________________________
>> Cuis mailing list
>> Cuis at jvuletich.org
>> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>
> _______________________________________________
> Cuis mailing list
> Cuis at jvuletich.org
> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>




More information about the Cuis mailing list