[ http://issues.apache.org/jira/browse/XERCESJ-1064?page=all ]
Michael Glavassevich reassigned XERCESJ-1064:
---------------------------------------------
Assign To: Michael Glavassevich
> Supplemental unicode characters are casted to char in the fatal error message
> -----------------------------------------------------------------------------
>
> Key: XERCESJ-1064
> URL: http://issues.apache.org/jira/browse/XERCESJ-1064
> Project: Xerces2-J
> Type: Bug
> Components: Serialization
> Versions: 2.6.2
> Reporter: Serghei Balaban
> Assignee: Michael Glavassevich
> Priority: Minor
>
> Invalid supplemental characters can be larger than 0xFFFF. Therefore invalid
> supplemental characters should not be casted to char type in surrogates(int
> high, int low) methods of BaseMarkupSerializer and XML11Serializer classes :
> protected void surrogates(int high, int low) throws IOException{
> if (XMLChar.isHighSurrogate(high)) {
> if (!XMLChar.isLowSurrogate(low)) {
> //Invalid XML
> fatalError("The character '"+(char)low+"' is an invalid XML
> character");
> }
> else {
> int supplemental = XMLChar.supplemental((char)high,
> (char)low);
> if (!XMLChar.isValid(supplemental)) {
> //Invalid XML
> fatalError("The character '"+(char)supplemental+"' is an
> invalid XML character");
> }
> else {
> if (content().inCData ) {
> _printer.printText("]]>&#x");
>
> _printer.printText(Integer.toHexString(supplemental));
> _printer.printText(";<![CDATA[");
> }
> else {
> printHex(supplemental);
> }
> }
> }
> } else {
> fatalError("The character '"+(char)high+"' is an invalid XML
> character");
> }
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]