Re: Nulls in XML

2008-02-12 Thread Jochen Wiedmann
On Feb 12, 2008 7:17 PM, Dan Fabulich <[EMAIL PROTECTED]> wrote: > When a test fails (by throwing a Throwable) Surefire needs to output the > message string of the failure in the XML test result output; Java strings > may contain the null character \u. Therefore, not all Java strings > can be

Re: Nulls in XML

2008-02-12 Thread Dan Fabulich
Jochen Wiedmann wrote: As he wrote, these characters are illegal, regardless of encoding, CDATA, and so on. XML is a text format and ASCII 0 is a binary character. The suggested way to embed binary data into XML is using the base64 encoding. Apart from that, I do not understand the use case. W

Re: Nulls in XML

2008-02-11 Thread Jochen Wiedmann
On Feb 12, 2008 1:26 AM, Jason van Zyl <[EMAIL PROTECTED]> wrote: > Where did you run into this? I think not showing what it actually is > makes it immediately not obvious what's going wrong. So I'm for > showing what it actually is. Can you just wrap in CDATA? As he wrote, these characters are i

Re: Nulls in XML

2008-02-11 Thread Dan Fabulich
Jason van Zyl wrote: Where did you run into this? One of our integration tests says: junit.framework.Assert.fail("\u"); When it's as bald as that it's not very important, but it's considerably more likely when you Assert.assertEquals(expected, actual) where they both contain control cha

Re: Nulls in XML

2008-02-11 Thread Jason van Zyl
On 11-Feb-08, at 12:49 PM, Dan Fabulich wrote: I didn't know this, so I imagine others might not. The string "�" is invalid XML. The character is simply not allowed in XML in any representation. XML 1.0 standard blocks most of the characters under x20, allowing only x9 xA and xD. XML

Re: Nulls in XML

2008-02-11 Thread Benjamin Bentmann
Should we emit "�", standards-be-damned? Dangerous: If some parser goes fully-XML-compliant, they will blame Surefire again. So just emitting "�" seems not really a long-term solution. (Expected "" but was "" ... Just imagine how painful it would be to track something like that down.) [...]

Re: Nulls in XML

2008-02-11 Thread Dan Fabulich
Dan Fabulich wrote: But neither does it seem right to insert "�" when it's illegal XML. Notably, Java will cheerfully print � in XML if you tell it to do so, and many parsers will figure out what to do with it just fine; the same applies to "". Notably, Java's XML parser does NOT know what t

Nulls in XML

2008-02-11 Thread Dan Fabulich
I didn't know this, so I imagine others might not. The string "�" is invalid XML. The character is simply not allowed in XML in any representation. XML 1.0 standard blocks most of the characters under x20, allowing only x9 xA and xD. XML 1.1 allows x1-x20, but still blocks x0. http://www