use of ezvcard.util.Utf8Writer in project ez-vcard by mangstadt.
the class JCardReaderTest method utf8.
@Test
public void utf8() throws Throwable {
// @formatter:off
String json = "[\"vcard\"," + "[" + "[\"version\", {}, \"text\", \"4.0\"]," + "[\"note\", {}, \"text\", \"\u019dote\"]" + "]" + "]";
File file = tempFolder.newFile();
Writer writer = new Utf8Writer(file);
writer.write(json);
writer.close();
JCardReader reader = new JCardReader(file);
VCardAsserter asserter = new VCardAsserter(reader);
asserter.next(V4_0);
asserter.simpleProperty(Note.class).value("\u019dote").noMore();
asserter.done();
// @formatter:on
}
use of ezvcard.util.Utf8Writer in project ez-vcard by mangstadt.
the class XCardReaderTest method read_utf8.
@Test
public void read_utf8() throws Exception {
// @formatter:off
String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<vcards xmlns=\"" + V4_0.getXmlNamespace() + "\">" + "<vcard>" + "<note><text>\u019dote</text></note>" + "</vcard>" + "</vcards>";
File file = tempFolder.newFile();
Writer writer = new Utf8Writer(file);
writer.write(xml);
writer.close();
XCardReader reader = new XCardReader(file);
VCardAsserter asserter = new VCardAsserter(reader);
asserter.next(V4_0);
asserter.simpleProperty(Note.class).value("\u019dote").noMore();
asserter.done();
// @formatter:on
}
Aggregations