From 0e1c037504740bccad09537fed214141d25cb594 Mon Sep 17 00:00:00 2001 From: Alex Wenckus Date: Mon, 17 Jul 2006 17:17:40 +0000 Subject: [PATCH] Fixed VCard encoding when creating the dom object. SMACK-151 git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@4525 b35dd754-fafc-0310-a699-88a17e54d16e --- source/org/jivesoftware/smackx/provider/VCardProvider.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/org/jivesoftware/smackx/provider/VCardProvider.java b/source/org/jivesoftware/smackx/provider/VCardProvider.java index 681d951de..42195c977 100644 --- a/source/org/jivesoftware/smackx/provider/VCardProvider.java +++ b/source/org/jivesoftware/smackx/provider/VCardProvider.java @@ -42,6 +42,8 @@ import java.util.ArrayList; */ public class VCardProvider implements IQProvider { + private final static String PREFERRED_ENCODING = "UTF-8"; + public IQ parseIQ(XmlPullParser parser) throws Exception { StringBuffer sb = new StringBuffer(); try { @@ -81,7 +83,8 @@ public class VCardProvider implements IQProvider { try { DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document document = documentBuilder.parse(new ByteArrayInputStream(xmlText.getBytes())); + Document document = documentBuilder.parse( + new ByteArrayInputStream(xmlText.getBytes(PREFERRED_ENCODING))); new VCardReader(vCard, document).initializeFields();