Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test escape apos #52

Closed
wants to merge 1 commit into from
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