Skip to content

Commit

Permalink
Update TestCharset.java
Browse files Browse the repository at this point in the history
  • Loading branch information
pjfanning committed May 12, 2023
1 parent fcc0f44 commit 09d98cb
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.fasterxml.jackson.dataformat.xml.XmlMapper;
import com.fasterxml.jackson.dataformat.xml.XmlTestBase;
import com.fasterxml.jackson.dataformat.xml.XmlWriter;

import java.io.IOException;
import java.nio.charset.Charset;
Expand Down Expand Up @@ -45,7 +46,8 @@ public void testBig5ObjectWriter() throws IOException
stringBean.象形字 = "pictogram";
XmlMapper xmlMapper = new XmlMapper();
xmlMapper.configure(ToXmlGenerator.Feature.WRITE_XML_1_1, true);
byte[] xml = xmlMapper.writer().writeValueAsBytes(stringBean);
XmlWriter writer = (XmlWriter) xmlMapper.writer();
byte[] xml = writer.writeValueAsBytes(stringBean, big5);
System.out.write(xml);
System.out.println();
}
Expand Down

0 comments on commit 09d98cb

Please sign in to comment.