Cookie encoding

Waldo Bastian bastian at kde.org
Sat Oct 18 13:40:30 BST 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Saturday 18 October 2003 02:06 pm, Harri Porten wrote:
> Hi,
> 
> 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. (Should have used QCString instead)

> When a cookie is set 
> from JavaScript utf8 is still being used by HTMLDocument::setCookie().
> 
> Okay to commit the attached patch ?

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.

I strongly suspect that the code to lookup cookies needs adjustment too. I 
guess it gets the cookie as 8-bit data encoded in the QString as latin1. It 
will need to convert this to a QCString first and then from their convert to 
QString using the correct encoding (page encoding?)

> Harri.
> 
> P.S. Will try out what happens in other browser if Cookie strings contain
> characters > 255.

Cheers,
Waldo
- -- 
bastian at kde.org -=|[ SUSE, The Linux Desktop Experts ]|=- bastian at suse.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE/kTS+N4pvrENfboIRAugzAJsHAPgsx2Uz5OVm9neRS025h7mmkwCaA0xH
Rj7+/mFI3xZGgJw0yntbKqM=
=cJ+/
-----END PGP SIGNATURE-----




More information about the kfm-devel mailing list