[jdom-interest] Surrogate pair output support (unit test)

Jason Hunter jhunter at servlets.com
Thu May 7 18:39:08 PDT 2009


On May 7, 2009, at 6:35 AM, Olivier Jaquemet wrote:

> Hi all,
>
> In December 2007, Dave Byrne submitted a patch to add support for  
> surrogate pair output :
> http://www.jdom.org/pipermail/jdom-interest/2007-December/016016.html
>
> Unfortunately this patch has never made into any JDOM release, nor  
> in the cvs (as far as I could find)...

Correct.  I asked a few questions that didn't get a reply and I'm not  
expert enough on surrogate pair outputs to blaze ahead unless there's  
a test case to keep me honest.

> 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 :
> junit.framework.ComparisonFailure:
>   expected: <root>&#x10000; &#65536;</root>
>   but was: <root>&#xd800;&#xdc00; &#xd800;&#xdc00;</root>
> With the patch submitted by Dave, everything works fine.

Excellent!  With that I'll feel safer checking it in.  It doesn't seem  
in big demand, but if we can do that's right w/ surrogate pairs then  
we should.

-jh-



More information about the jdom-interest mailing list