From 1e329b5c344629d2d11eb57efe759df339d1e3d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Rosick=C3=BD?= Date: Wed, 9 Feb 2022 03:16:53 +0100 Subject: [PATCH] test apos --- test/org/jcodings/specific/TestEConv.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/org/jcodings/specific/TestEConv.java b/test/org/jcodings/specific/TestEConv.java index 326c73f3..7337b19b 100644 --- a/test/org/jcodings/specific/TestEConv.java +++ b/test/org/jcodings/specific/TestEConv.java @@ -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);