Cookie encoding
Harri Porten
porten at froglogic.com
Sat Oct 18 23:39:32 BST 2003
On Sat, 18 Oct 2003, Waldo Bastian wrote:
> > cookie handling is not 8-bit clean as show in bug report #53011. I saw
> > that Waldo now nailed down the encoding to be latin1.
>
> Not exactly. The cookie is basically stored as 8-bit data regardless of
> encoding. But since we use QStrings that 8-bit data is stored in the QString
> as latin1.
That's what I meant. Phrased that a bit too short.
> (Should have used QCString instead)
Yes. Would have made the code safer against accidental conversions.
> Your patch is basically right but I think the latin1 part is wrong. I think
> that it should use the encoding of the page instead, but you will need to
> check how other browsers handle this.
With Mozilla I couldn't find any difference when switching the encoding.
In fact, when I the Unicode experiment and put e.g. 0x20AC in I got 0xAC
back. So latin1() seems fine for the extended ASCII range. If we wanted to
match the "undefined" Mozilla behaviour in the out-of-range higher range
we'd have to and all characters by 0xFF to avoid the '?' of latin1().
Harri.
More information about the kfm-devel
mailing list