[plt-scheme] weird utf-8 servlet output

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Tue Oct 17 20:55:39 EDT 2006

This is correct in SVN. I think it was fixed about a month or so ago.

Jay

On 10/17/06, Aycan iRiCAN <aycan.irican at core.gen.tr> wrote:
> Jens Axel Søgaard <jensaxel at soegaard.net> writes:
>
> > Aycan iRiCAN skrev:
> >
> >> Looking at the source of the output some characters lost at the end:
> >>
> >> "<html><head><meta content="text/html; charset=utf-8;" http-equiv="Content-Type" /><title>Sample</title></head><body><h1>Türkçe</h1></body></html"
> >
> > Did you try more than one browser? (Just to rule out
> > an unfortunate browser<->server interaction.)
> >
> > Or maybe it is related to bug 7222?
>
> Hmm yes, it's the bug 7222. I quickly looked at the response.scm
> source. I think the content-length of the response have been computed
> badly around line 147.
>
> ...
> (apply + (map
>            (lambda (c)
>               (if (string? c)
>                   (string-length c)   ;; here it is
>                   (bytes-length c)))
>            (cdr resp)))
> ...
>
> Here is a demonstration of the situation;
>
> > (string-length "şişko")
> 5
> > (bytes-length (string->bytes/locale "şişko"))
> 7
>
> I tried to convert the string to bytes before deciding it's length
> (using something like the demo above) but I got this error:
>
> compile: variable not provided (directly or indirectly and at the expected position) from module: |,/usr/local/plt/lib/plt/collects/web-server/response| in: provide/contract-contract-id-TEXT/HTML-MIME-TYPE.11
>
> Best Regards,
>
> --
> Aycan iRiCAN
> C0R3 Computer Security Group
> http://people.core.gen.tr/~aycan.irican/
>
>
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
>
>
>


-- 
Jay McCarthy <jay.mccarthy at gmail.com>
http://jay.teammccarthy.org

Posted on the users mailing list.