Hello
I try post 'paste' to
http://1337.pastebay.c om/
using python urlencode,
when i check headers with Firefox liveHttpHeaders , the
ő character encoded to
%26%23337%3B
but when try in python:
In [28]: urlencode({'cod e2':u'ő'.encode ('iso-8859-1')})
Out[28]: 'code2=%C5%91'
In [29]: urlencode({'cod e2':u'ő'.encode ('utf8')})
Out[29]: 'code2=%C3%85%C 2%91'
I cant understand why FF, encode differ from python.
When i send post form in python, characters became weird on given html page...
In [32]: o = urllib2.build_o pener()
In [33]: o.open('http://1337.pastebay.c om/pastebay.php',' parent_pid=1163 99&format=vb&co de2=%C5%91&prot ected=&poster=& paste=Send&expi ry=m&pam=')
Out[33]: <addinfourl at 47655680 whose fp = <socket._fileob ject object at 0x2d635d0>>
In [34]: _.url
Out[34]: 'http://1337.pastebay.c om/116408'
as you see on url above, i got: ' Å‘ '
I try post 'paste' to
http://1337.pastebay.c om/
using python urlencode,
when i check headers with Firefox liveHttpHeaders , the
ő character encoded to
%26%23337%3B
but when try in python:
In [28]: urlencode({'cod e2':u'ő'.encode ('iso-8859-1')})
Out[28]: 'code2=%C5%91'
In [29]: urlencode({'cod e2':u'ő'.encode ('utf8')})
Out[29]: 'code2=%C3%85%C 2%91'
I cant understand why FF, encode differ from python.
When i send post form in python, characters became weird on given html page...
In [32]: o = urllib2.build_o pener()
In [33]: o.open('http://1337.pastebay.c om/pastebay.php',' parent_pid=1163 99&format=vb&co de2=%C5%91&prot ected=&poster=& paste=Send&expi ry=m&pam=')
Out[33]: <addinfourl at 47655680 whose fp = <socket._fileob ject object at 0x2d635d0>>
In [34]: _.url
Out[34]: 'http://1337.pastebay.c om/116408'
as you see on url above, i got: ' Å‘ '
Comment