- **status**: assigned --> fixed
- **Comment**:

~~~
commit c035b53056d1cce502a4fea40d5d48e6770df73e (HEAD -> develop, 
origin/develop)
Author: tai.h.nguyen <[email protected]>
Date:   Mon Apr 28 17:57:18 2025 +0700

    imm: Fix immxml-merge failure caused by encoding mismatch [#3371]
    
    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, then immxml-merge will fail.
    
    UTF-8 encoding will be applied to the output files if any input file
    uses UTF-8 encoding.

~~~



---

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

**Status:** fixed
**Milestone:** 5.25.09
**Created:** Mon Apr 28, 2025 03:43 AM UTC by Nguyen Huynh Tai
**Last Updated:** Sat May 03, 2025 01:05 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

Reply via email to