[jdom-interest] RE: Surrogate pair output support (unit test)
dbyrne at mdb.com
Thu May 7 08:17:51 PDT 2009
When I submitted the patch, Jason Hunter followed up and asked for test
cases before applying it to CVS which I never did. Perhaps you could
whip up some junit tests?
From: Olivier Jaquemet [mailto:olivier.jaquemet at jalios.com]
Sent: Thursday, May 07, 2009 6:36 AM
To: jdom-interest at jdom.org
Cc: Dave Byrne
Subject: Surrogate pair output support (unit test)
In December 2007, Dave Byrne submitted a patch to add support for
surrogate pair output :
Unfortunately this patch has never made into any JDOM release, nor in
the cvs (as far as I could find)...
A simple test case for this bug is attached and end of this mail.
As of version 1.1, the test will fail with the following error :
expected: <root>𐀀 𐀀</root>
but was: <root>�� ��</root>
With the patch submitted by Dave, everything works fine.
Could you add his patch for the next release of JDOM ?
Thank your for you answer !
The unit test :
public void testHighSurrogatePair() throws JDOMException, IOException
SAXBuilder builder = new SAXBuilder();
Document doc = builder.build(new StringReader("<?xml
Format format = Format.getCompactFormat().setEncoding("ISO-8859-1");
XMLOutputter outputter = new XMLOutputter(format);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
String xml = baos.toString();
assertEquals("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>" +
"<root>𐀀 𐀀</root>" +
More information about the jdom-interest