DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41846>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41846

           Summary: Canonicalization failed with some latin2 characters
           Product: Security
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: critical
          Priority: P1
         Component: Canonicalization
        AssignedTo: security-dev@xml.apache.org
        ReportedBy: [EMAIL PROTECTED]


Canonicalization failed with some latin2 characters 
'&#269;&#263;žš&#273;&#268;&#262;ŽŠ&#272;'(leters with
caron, ... ).

Release 1.3.0 don't have such problem.

Code which demonstrates bug:

// parse document
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
DocumentBuilder db = dbf.newDocumentBuilder();
// text contains some latin2 characters 
'&#269;&#263;žš&#273;&#268;&#262;ŽŠ&#272;'
String text = new
String("<text>\u010D\u0107\u017E\u0161\u0111\u010C\u0106\u017D\u0160\u0110</text>");
Document doc = db.parse(new ByteArrayInputStream(text.getBytes("UTF-8")));
Element e_latin2 = doc.getDocumentElement();
Canonicalizer20010315WithComments c14 = new Canonicalizer20010315WithComments();
byte[] canon_bin = c14.engineCanonicalizeSubTree(e_latin2);

if (Arrays.equals(text.getBytes("UTF-8"), canon_bin))
   System.out.println("OK");
else
   System.out.println("Failed");

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

Reply via email to