Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions test/org/jcodings/specific/TestEConv.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,19 @@ public void testXMLWithCharref() throws Exception {
Assert.assertArrayEquals("\"<♥>&"♡"\"".getBytes(), Arrays.copyOf(dest, destP.p));
}

@Test
public void testEscapeApos() throws Exception {
EConv econv = TranscoderDB.open("".getBytes(), "".getBytes(), EConvFlags.XML_ATTR_CONTENT_DECORATOR);

byte[] src = "&'&".getBytes();

byte[] dest = new byte[16];
Ptr destP = new Ptr(0);

econv.convert(src, new Ptr(0), src.length, dest, destP, dest.length, 0);
Assert.assertEquals(new String("&'&".getBytes()), new String(Arrays.copyOf(dest, destP.p)));
}

@Test
public void testXMLText() throws Exception {
// EConv econv = TranscoderDB.open("utf-8".getBytes(), "iso-2022-jp".getBytes(), EConvFlags.XML_TEXT_DECORATOR);
Expand Down