Menu

#1 XMLWriter should deal with surrogates in its UTF-16 input

open
nobody
None
5
2005-05-17
2005-05-17
No

If XMLWriter is given input that includes UTF-16
surrogate characters outside the BMP, it should decode
them so the correct numeric reference is included in
the output.

This test suite indicates cases to consider.

Discussion

  • Joseph Walton

    Joseph Walton - 2005-05-17

    Test cases for UTF-16 surrogates.

     
  • Joseph Walton

    Joseph Walton - 2005-05-17

    Logged In: YES
    user_id=847250

    Patch to pass tests.

     
  • Joseph Walton

    Joseph Walton - 2005-05-28

    Patch to deal with surrogate characters.

     
  • Joseph Walton

    Joseph Walton - 2005-05-28

    Logged In: YES
    user_id=847250

    Missed a case:

    // A valid character that caused a problem
    public void testValidNonSurrogate() throws
    SAXException, IOException
    {
    xw.dataElement("x", "\uFF09");
    xw.endDocument();
    xw.flush();

    assertEquals("<x>&#65289;</x>",
    sw.toString().trim());
    }

    Patch resubmitted to deal with this correctly.

     

Log in to post a comment.