Here is the code I use to receive the data:
dom = minidom.parseString(request.raw_post_data)
default charset on django side is utf-8.
Please advise. Thanks.
Laurent
- Original Message
From: Stefan Behnel
To: python-list@python.org
Sent: Monday, September 7, 2009 11:50:28 PM
Subject:
Laurent Luce wrote:
> Can someone confirm that the issue here is I need to encode the xml data
> using:
> # encode as UTF-8
> utf8_string = xml.encode( 'utf-8' )
> and then post it to the server.
Well, since you declared it to be UTF-8, it must be UTF-8 encoded.
However, your question seems to i
eptember 7, 2009 10:50:22 PM
Subject: Re: unicode + xml
The xml data is generated on Windows (python 2.6.2) and sent using a post
request to a Django server. The django server is running on Ubuntu server with
python 2.6.2. The post data is passed to minidom for parsing.
Laurent
- Origin
@python.org
Sent: Monday, September 7, 2009 9:15:15 PM
Subject: Re: unicode + xml
"Laurent Luce" wrote in message
news:255473.44957...@web54203.mail.re2.yahoo.com...
> Hello,
>
> I am trying to do the following:
>
> - read list of folders in a specific directory: os.listdir
"Laurent Luce" wrote in message
news:255473.44957...@web54203.mail.re2.yahoo.com...
Hello,
I am trying to do the following:
- read list of folders in a specific directory: os.listdir() - some
folders have Japanese characters
- post list of folders as xml to a web server: I used content-type
Hello,
I am trying to do the following:
- read list of folders in a specific directory: os.listdir() - some folders
have Japanese characters
- post list of folders as xml to a web server: I used content-type 'text/xml'
and I use '' to start the xml data.
- on the server side (Django), I get the
Martin v. Löwis wrote:
>> Unless, obviously, you were serialising to a non-utf8 encoding. But since the
>> "toxml()" method seems to return unicode here (which sounds surprising), I
>> expect it a) to provide no XML declaration at all or b) to be broken anyway.
>
> Or c) the user forgot to specify
> Unless, obviously, you were serialising to a non-utf8 encoding. But since the
> "toxml()" method seems to return unicode here (which sounds surprising), I
> expect it a) to provide no XML declaration at all or b) to be broken anyway.
Or c) the user forgot to specify the encoding= parameter in to
Gabriel Genellina wrote:
> En Mon, 09 Jul 2007 20:11:24 -0300, Martin <[EMAIL PROTECTED]>
> escribió:
>
>> I get below error when trying to write unicode xml to a zipfile.
>>
>> zip.writestr('content.xml', content.toxml())
>> File "
En Mon, 09 Jul 2007 20:11:24 -0300, Martin <[EMAIL PROTECTED]>
escribió:
> I get below error when trying to write unicode xml to a zipfile.
>
> zip.writestr('content.xml', content.toxml())
> File "/usr/lib/python2.4/zipfile.py", line 460, in writestr
I get below error when trying to write unicode xml to a zipfile.
zip.writestr('content.xml', content.toxml())
File "/usr/lib/python2.4/zipfile.py", line 460, in writestr
zinfo.CRC = binascii.crc32(bytes) # CRC-32 checksum
UnicodeEncodeError: 'ascii'
11 matches
Mail list logo