use of ezvcard.util.Gobble in project ez-vcard by mangstadt.
the class XCardDocumentTest method write_utf8.
@Test
public void write_utf8() throws Throwable {
VCard vcard = new VCard();
vcard.addNote("\u019dote");
XCardDocument xcard = new XCardDocument();
xcard.addVCard(vcard);
File file = tempFolder.newFile();
xcard.write(file);
String xml = new Gobble(file).asString("UTF-8");
assertTrue(xml.matches("(?i)<\\?xml.*?encoding=\"utf-8\".*?\\?>.*"));
assertTrue(xml.matches(".*?<note><text>\u019dote</text></note>.*"));
}