---

**[tickets:#3371] imm: immxml-merge fails when merging XML files with different 
encodings in Python 2**

**Status:** unassigned
**Milestone:** 5.25.04
**Created:** Mon Apr 28, 2025 03:43 AM UTC by Nguyen Huynh Tai
**Last Updated:** Mon Apr 28, 2025 03:43 AM UTC
**Owner:** nobody


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

Reply via email to