Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.4.4
-
Labels:None
-
Testcase included:yes
-
Number of attachments :
Description
The xml pull parser in plexus-utils(MXParser.java) can't handle the encoding declaration in XML declaration.
So, it's impossible to use an encoding different from system default encoding. This is critical in Japan, because
there is two commonly used encodings in Japanese environment(SJIS and EUC-JP).
I think MXParser should handle encoding declaration in xml as described in w3c specification/
http://www.w3.org/TR/REC-xml/#sec-guessing
I tried to fix this problem(see attachment).
I changed the setInput(InputStream) method to detect encoding in xml declaration.
For writing this code, I referred to source code of Apache Xerces.
UCS-4 and UCS-2 isn't supported in this implementation, because
these encoding isn't supported by Sun JDK.
Xerces solves this problem by providing original reader for these encodings. I think Xerces's solution is
too complex for plexus-utils.
To solve this issue, it's not sufficient only to change plexus-utils, because
DefaultMavenProjectBuilder reads POM by FileReader without specifying encoding.
Issue Links
- is depended upon by
-
MANTTASKS-14
Ant Tasks do not work on the ZOS
-
-
MNG-2025
POM is still not read using the right encoding
-
-
DOXIA-133
default XML encoding (UTF-8) or XML encoding set in XML files is ignored: inputEncoding is used instead
-
-
MECLIPSE-56
Generated .project-file misses encoding declaration
-
-
MNG-2254
the encoding parameter in xml declaration of POM is ignored
-
-
MSITE-239
encoding declaration in site.xml is ignored
-
- is related to
-
MEVENIDE-449
Mevenide plugin stumbels upon non ASCII characters in the path to the .m2 directory
-
-
MSITE-19
Various encoding problems with InputStream and XML
-
- is superceded by
-
MNG-2255
Use a external XML Pull parser instead of plexus one
-
patch file for plexus-utils.