C. Benson Manica, 21.04.2010 19:19:
I have the following simple script running on 2.5.2 on a machine where
the default character encoding is "ascii":
#!/usr/bin/env python
#coding: utf-8
import xml.dom.minidom
import codecs
str=u""
doc=xml.dom.minidom.parseString( str )
xml=doc.toxml( encoding
C. Benson Manica wrote:
> On Apr 21, 2:25 pm, Peter Otten <__pete...@web.de> wrote:
>
>> Are you sure that your script has
>>
>> str = u"..."
>>
>> like in your post and not just
>>
>> str = "..."
>
> No :-)
>
> str=u" \"ó\"/>"
> doc=xml.dom.minidom.parseString( str.encode("utf-8") )
> xml=doc.
On Apr 21, 2:25 pm, Peter Otten <__pete...@web.de> wrote:
> Are you sure that your script has
>
> str = u"..."
>
> like in your post and not just
>
> str = "..."
No :-)
str=u""
doc=xml.dom.minidom.parseString( str.encode("utf-8") )
xml=doc.toxml( encoding="utf-8")
file=codecs.open( "foo.xml", "w
C. Benson Manica wrote:
> On Apr 21, 1:58 pm, Peter Otten <__pete...@web.de> wrote:
>> C. Benson Manica wrote:
>>> (snip)
>>
>> It seems that parseString() doesn't like unicode
>
> Yes, I noticed that, and I already tried...
>
>> -- let's try a byte string
>> then:
>>
>> >>> doc = xml.dom.minido
On Apr 21, 1:58 pm, Peter Otten <__pete...@web.de> wrote:
> C. Benson Manica wrote:
>> (snip)
>
> It seems that parseString() doesn't like unicode
Yes, I noticed that, and I already tried...
> -- let's try a byte string
> then:
>
> >>> doc = xml.dom.minidom.parseString(s.encode("utf-8"))
> >>> xm
C. Benson Manica wrote:
> I have the following simple script running on 2.5.2 on a machine where
> the default character encoding is "ascii":
>
> #!/usr/bin/env python
> #coding: utf-8
>
> import xml.dom.minidom
> import codecs
>
> str=u" \"ó\"/>"
> doc=xml.dom.minidom.parseString( str )
> xml=
I have the following simple script running on 2.5.2 on a machine where
the default character encoding is "ascii":
#!/usr/bin/env python
#coding: utf-8
import xml.dom.minidom
import codecs
str=u""
doc=xml.dom.minidom.parseString( str )
xml=doc.toxml( encoding="utf-8" )
file=codecs.open( "foo.xml"