New submission from mahboubi:
my python code embedded in C program, uses etree from lxml to write a plain
string as element attribute in xml file. the problem is when my string contains
non english characters(non ascii), the program fails to write even with unicode
conversion such as unicode
mahboubi added the comment:
I have just tried to do this task using xml.etree.ElementTree and still have
the same problem.
In the file 'write_to_xml1.py' I'm trying to develop some function that creates
an xml file and then add data containing non ascii characters.The python
mahboubi added the comment:
Thank you xiang zhang for your reply.
I think that the problem is not in xml_file.write(doc.toprettyxml()) because it
works using python only, and the C problem dosen't work since you didn't get
any 'alerte' balise.
--
sta
mahboubi added the comment:
Also, using codecs.open(encoding='utf8') gives unhadled exception in C? but no
problem using python code only.
--
___
Python tracker
<http://bugs.python.o
mahboubi added the comment:
Probably it's my fault to use the word 'crash', what I mean is that generated
report by python program contains the right result(the 'alerte' balise is
added) but the other report generated by the same python program embedde in C
did
Changes by mahboubi :
--
type: crash -> behavior
___
Python tracker
<http://bugs.python.org/issue30195>
___
___
Python-bugs-list mailing list
Unsubscrib
mahboubi added the comment:
problem solved, It's not related to embedding python in C, Ijust had to use
mystring.decode('utf-8') instead of unicode(mystring,"utf-8")
--
stage: test needed -> resolved
status: open -> closed
__