// This test will only pass if Java's NEL handling is fixed
public void testEBCDIC037()
throws ParsingException, UnsupportedEncodingException {
Builder builder = new Builder();
ByteArrayOutputStream out = new ByteArrayOutputStream();
try {
// Write data into a byte array using encoding
Serializer serializer = new Serializer(out, "Cp037");
serializer.write(doc);
serializer.flush();
out.flush();
out.close();
byte[] result = out.toByteArray();
// We have to look directly rather than converting to
// a String because Java gets the conversion of NEL to
// Unicode wrong
for (int i = 0; i < result.length; i++) {
if (result[i] == 0x15) fail("Bad NEL output");
}
InputStream in = new ByteArrayInputStream(result);
Document reparsed = builder.build(in);
assertEquals(doc, reparsed);
}
catch (UnsupportedEncodingException ex) {
throw ex;
}