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

2017-05-16 Thread Xiang Zhang
Changes by Xiang Zhang : -- resolution: -> not a bug ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[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 ___ Python tracker

[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 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[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 didn't give the right result (report

[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 ___

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

2017-04-30 Thread Xiang Zhang
Xiang Zhang added the comment: But I didn't see any crash either. You'd better provide a simple reproduce program, not involving so much logic. Or could you debug it and provide a crash backtrace? -- ___ Python tracker

[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. -- status: pending -> open __

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

2017-04-30 Thread Xiang Zhang
Xiang Zhang added the comment: IMHO this doesn't look like an error in xml library. With a little tweak in of your problem: adding encoding declaration, removing not needed imports, replace open with codecs.open(encoding='utf8') in create_report, the C problem works fine for me: [tmp]$ cat es

[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 program works perf

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

2017-04-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: lxml is not the part of the Python standard library. Use lxml bug tracker if your issue is specific for lxml. If you can reproduce the issue with xml.etree.ElementTree from the stdlib, please provide a simple example code that does this. -- nosy: +s

[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(m