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
This commit is contained in:
Alex Wenckus 2006-07-17 17:17:40 +00:00 committed by alex
parent e304af9122
commit 0e1c037504
1 changed files with 4 additions and 1 deletions

View File

@ -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();