mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-29 23:42: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:
parent
e304af9122
commit
0e1c037504
1 changed files with 4 additions and 1 deletions
|
@ -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();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue