[issue30195] writing non-ascii characters in xml file using python code embedded in C

2017-04-28 Thread mahboubi
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

[issue30195] writing non-ascii characters in xml file using python code embedded in C

2017-04-29 Thread mahboubi
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

[issue30195] writing non-ascii characters in xml file using python code embedded in C

2017-04-30 Thread mahboubi
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

[issue30195] writing non-ascii characters in xml file using python code embedded in C

2017-04-30 Thread mahboubi
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

[issue30195] writing non-ascii characters in xml file using python code embedded in C

2017-04-30 Thread mahboubi
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

[issue30195] writing non-ascii characters in xml file using python code embedded in C

2017-05-06 Thread mahboubi
Changes by mahboubi : -- type: crash -> behavior ___ Python tracker <http://bugs.python.org/issue30195> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue30195] writing non-ascii characters in xml file using python code embedded in C

2017-05-16 Thread mahboubi
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 __