Wojciech Kocjan <[EMAIL PROTECTED]> writes:
> 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...
Hrmm... I see. Strange.
> 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.
What happens when it's URL-encoded non UTF?
I hate this stuff.. why can't everyone just use American English?
Life would be so much easier (and faster, too!);-)
> 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 :)
This seems to work, and it still passes the tests in dtcl.test.
Frankly, I'm at a loss as to what's going on... I don't seem to be
able to get this i18n stuff right - and am beginning to wonder if it
is indeed possible.
--
David N. Welton
Free Software: http://people.debian.org/~davidw/
Apache Tcl: http://tcl.apache.org/
Personal: http://www.efn.org/~davidw/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]