- **Milestone**: 5.25.04 --> 5.25.09
---
**[tickets:#3371] imm: immxml-merge fails when merging XML files with different
encodings in Python 2**
**Status:** assigned
**Milestone:** 5.25.09
**Created:** Mon Apr 28, 2025 03:43 AM UTC by Nguyen Huynh Tai
**Last Updated:** Mon Apr 28, 2025 04:18 AM UTC
**Owner:** Nguyen Huynh Tai
In python2, the immxml-merge tool uses the encoding of the first input file to
set the output file's encoding. If any subsequent input files require UTF-8
encoding but the first file is not encoded in UTF-8, immxml-merge will fail.
~~~
encoding in first source xml document: None
Traceback (most recent call last):
File "./src/imm/tools/immxml-merge", line 627, in <module>
main(sys.argv[1:])
File "./src/imm/tools/immxml-merge", line 619, in main
merged_doc.save_result()
File "./src/imm/tools/immxml-merge", line 389, in save_result
file_object.write(string + "\n")
UnicodeEncodeError: 'ascii' codec can't encode character u'\xc5' in position
229: ordinal not in range(128)
~~~
---
Sent from sourceforge.net because [email protected] is
subscribed to https://sourceforge.net/p/opensaf/tickets/
To unsubscribe from further messages, a project admin can change settings at
https://sourceforge.net/p/opensaf/admin/tickets/options. Or, if this is a
mailing list, you can unsubscribe from the mailing list._______________________________________________
Opensaf-tickets mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-tickets