Skip to content

Commit 09d98cb

Browse files
committed
Update TestCharset.java
1 parent fcc0f44 commit 09d98cb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/test/java/com/fasterxml/jackson/dataformat/xml/ser/TestCharset.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
44
import com.fasterxml.jackson.dataformat.xml.XmlTestBase;
5+
import com.fasterxml.jackson.dataformat.xml.XmlWriter;
56

67
import java.io.IOException;
78
import java.nio.charset.Charset;
@@ -45,7 +46,8 @@ public void testBig5ObjectWriter() throws IOException
4546
stringBean.象形字 = "pictogram";
4647
XmlMapper xmlMapper = new XmlMapper();
4748
xmlMapper.configure(ToXmlGenerator.Feature.WRITE_XML_1_1, true);
48-
byte[] xml = xmlMapper.writer().writeValueAsBytes(stringBean);
49+
XmlWriter writer = (XmlWriter) xmlMapper.writer();
50+
byte[] xml = writer.writeValueAsBytes(stringBean, big5);
4951
System.out.write(xml);
5052
System.out.println();
5153
}

0 commit comments

Comments
 (0)