1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-26 14:02:06 +01:00

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

View file

@ -42,6 +42,8 @@ import java.util.ArrayList;
*/ */
public class VCardProvider implements IQProvider { public class VCardProvider implements IQProvider {
private final static String PREFERRED_ENCODING = "UTF-8";
public IQ parseIQ(XmlPullParser parser) throws Exception { public IQ parseIQ(XmlPullParser parser) throws Exception {
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
try { try {
@ -81,7 +83,8 @@ public class VCardProvider implements IQProvider {
try { try {
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); 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(); new VCardReader(vCard, document).initializeFields();