I have a script that uses utf-8 encoding. Now I would like to send some
data to an application ( on another server) that uses 1250 encoding.
How can I tell the server that the coming data will be in utf-8 code?
I tried this
params='some data'
h = httplib.HTTP(se lf.host)
h.putheader("Co ntent-type", "multipart/form-data;
boundary=---------------------------7d329422844")
h.putheader("Co ntent-length", "%d" % len(params))
h.putheader("Ac cept-Language", "us-en")
h.putheader('Ac cept', 'image/gif, image/x-xbitmap, image/jpeg,
image/pjpeg, */*')
h.putheader('Us er-Agent', 'Mozilla/4.0 (compatible; MSIE 6.0; Windows
NT 5.1)')
h.putheader('Ho st', 'server')
h.endheaders()
......
.....
but it doesn't work. The data are not encoded properly
Thanks for help
L.B.
data to an application ( on another server) that uses 1250 encoding.
How can I tell the server that the coming data will be in utf-8 code?
I tried this
params='some data'
h = httplib.HTTP(se lf.host)
h.putheader("Co ntent-type", "multipart/form-data;
boundary=---------------------------7d329422844")
h.putheader("Co ntent-length", "%d" % len(params))
h.putheader("Ac cept-Language", "us-en")
h.putheader('Ac cept', 'image/gif, image/x-xbitmap, image/jpeg,
image/pjpeg, */*')
h.putheader('Us er-Agent', 'Mozilla/4.0 (compatible; MSIE 6.0; Windows
NT 5.1)')
h.putheader('Ho st', 'server')
h.endheaders()
......
.....
but it doesn't work. The data are not encoded properly
Thanks for help
L.B.
Comment