intersystems / intersystems/ipm
SAX parser generate errors when reading a 'module.xml' containing multi-byte characters
- Dominant language
- ObjectScript
- Stars
- 41
- Forks
- 29
- Avg merge
- 23h 54m
- Merged PRs (30d)
- 4
Description
## Describe the bug
SAX parser generate errors when reading a 'module.xml' containing multi-byte characters
## To Reproduce
Steps to reproduce the behavior:
1. Create a package and module.xml which contains Japanese text.
2. Run IPM command 'load '
3. The command returns below error
ERROR! SAX XML parser error: expected end of tag 'Description' while processing Anonymous Stream at line 14 offset 7
## Expected behavior
Succeed to load the package.
## System information (please complete the following information):
- IPM version: 0.10.9
- IRIS version: IRIS for Windows (x86-64) 2025.1.1 (Build 308U) Thu Jul 10 2025 16:00:01 EDT
- OS: Windows 11
- Docker or local: local
## Additional context
The SAX parser included with IRIS performs code conversion based on the encoding attribute of XML tags, so it is better to read `module.xml` as a binary stream.
I modified the following section of the `GetModuleObjectFromPath` method in the `IPM.Utils.Module` class and confirmed that it can now be read.
from:
set stream = ##class(%Stream.FileCharacter).%New()
to:
set stream = ##class(%Stream.FileBinary).%New()
Contributor guide
Research direction
Start with the GetModuleObjectFromPath method in the IPM.Utils.Module class and inspect how module.xml is opened before SAX parsing. Reproduce the issue by loading a package whose module.xml contains Japanese text, then verify that loading succeeds with the binary stream approach described in the issue.
Written by the indexing model from the issue text.
Assessment
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 82/100