File tree Expand file tree Collapse file tree
src/org/apache/xml/serializer Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1455,22 +1455,23 @@ else if ((ch < m_maxCharacter) && (m_maxCharacter == 0xFFFF)
14551455 {
14561456 writer.write(ch); // no escaping in this case
14571457 }
1458- else
14591458 */
1460- String outputStringForChar = m_charInfo .getOutputStringForChar (ch );
1461- if (null != outputStringForChar )
1462- {
1463- writer .write (outputStringForChar );
1464- }
1465- else if (escapingNotNeeded (ch ))
1466- {
1467- writer .write (ch ); // no escaping in this case
1468- }
1469- else
1470- {
1471- writer .write ("&#" );
1472- writer .write (Integer .toString (ch ));
1473- writer .write (';' );
1459+ else {
1460+ String outputStringForChar = m_charInfo .getOutputStringForChar (ch );
1461+ if (null != outputStringForChar )
1462+ {
1463+ writer .write (outputStringForChar );
1464+ }
1465+ else if (escapingNotNeeded (ch ))
1466+ {
1467+ writer .write (ch ); // no escaping in this case
1468+ }
1469+ else
1470+ {
1471+ writer .write ("&#" );
1472+ writer .write (Integer .toString (ch ));
1473+ writer .write (';' );
1474+ }
14741475 }
14751476 }
14761477 cleanStart = i + 1 ;
Original file line number Diff line number Diff line change @@ -1600,6 +1600,14 @@ else if (m_encodingInfo.isInEncoding(ch)) {
16001600 // just leave it get added on to the clean characters
16011601
16021602 }
1603+ else if (Encodings .isHighUTF16Surrogate (ch )) {
1604+ writeOutCleanChars (chars , i , lastDirtyCharProcessed );
1605+ writeUTF16Surrogate (ch , chars , i , end );
1606+ // two input characters processed
1607+ // this increments by one and the for()
1608+ // loop i elf increments by another one.
1609+ lastDirtyCharProcessed = ++i ;
1610+ }
16031611 else {
16041612 // This is a fallback plan, we should never get here
16051613 // but if the character wasn't previously handled
You can’t perform that action at this time.
0 commit comments