On 30 Jul 2001, David N. Welton wrote:

> Wojciech Kocjan <[EMAIL PROTECTED]> writes:
> 
> > I'm using 0.10.0 and when doing headers setcookie the cookies are
> > sent in UTF-8.
>  
> > This is probably due to simple Tcl_GetString() ... 
> It probably depends on the encoding too.  Can you give me a specific
> test to try on my own system, so that I can determine when it is
> working and when it isn't?  The best thing would be a test case for
> dtcl.test, but anything simple will do.

<?
hgetvars
set str "\xa1\xb1\xc1"
catch {set str $COOKIES(test)}
headers setcookie -name test -value $str
hputs "SL=[string length $str]"
?>

It should constantly show SL=3, but for me it just grows and grows...

The data is URL-encoded UTF8. Everything works when I don't translate it
on setting the COOKIES() array. But basically grows by x2 for chars >0x80.

So this is your test case for now :)

> > For now I've fixed ::request::COOKIE setting NOT to translate string
> > to utf... This is a quick-hack, but it works.
> Can you share it with us?

Creating a #define STR_TO_OBJ as simple Tcl_NewStringObj() :>

And redefining the Tcl_Set2(interp,"COOKIES",...) to use STR_TO_OBJ
instead of STR_TO_UTF_TO_OBJ :)

> > Since I'm not sure on how to fix it right, maybe someone here (David
> > :) could do that? [i'm not sure on how do ap_* functions work :)
> 
> Well, it needs to be sent as URLencoded information, of course.

Yeap, I was the one to tell you that long time ago ;>

> Sorry for the slow response, but I have been working at a computer
> expo here in Padova for the past few days.

Hehe. These things happen.

--
Wojtek Kocjan
[EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to