aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/objects
diff options
context:
space:
mode:
authorGravatar Szymon Tomasz Stefanek2008-03-22 15:38:01 +0000
committerGravatar Szymon Tomasz Stefanek2008-03-22 15:38:01 +0000
commit315744bf2492df897dd04c83fe1b6fafbc793f44 (patch)
tree7fb7d38571a556d89ab63f239698a173fffb7cfa /src/modules/objects
parentFixed a buggie related to kvs object deletion and updated the newsticker scri... (diff)
downloadKVIrc-315744bf2492df897dd04c83fe1b6fafbc793f44.tar.gz
KVIrc-315744bf2492df897dd04c83fe1b6fafbc793f44.tar.bz2
KVIrc-315744bf2492df897dd04c83fe1b6fafbc793f44.zip
Another fix for the xmlreader attempt to nearly-correctly handle the stream encoding
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@1249 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/objects')
-rw-r--r--src/modules/objects/class_xmlreader.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/modules/objects/class_xmlreader.cpp b/src/modules/objects/class_xmlreader.cpp
index d3c355c0a..927dcd80a 100644
--- a/src/modules/objects/class_xmlreader.cpp
+++ b/src/modules/objects/class_xmlreader.cpp
@@ -29,6 +29,8 @@
#include "kvi_kvs_variantlist.h"
#include "kvi_kvs_hash.h"
+#include "kvi_qstring.h"
+
/*
@doc: xmlreader
@@ -316,7 +318,13 @@ bool KviKvsObject_xmlreader::function_parse(KviKvsObjectFunctionCall *c)
m_szLastError = "";
KviXmlHandler handler(this);
QXmlInputSource source;
- source.setData(szString);
+ // We have a problem here.. most kvirc functions already interpret the data
+ // read from files. We should have binary data handling features to get this to work correctly.
+ // The following snippet of code tries to provide a best-effort workaround.
+ KviQCString utf8data = KviQString::toUtf8(szString);
+ QByteArray data = utf8data;
+ data.truncate(utf8data.length()); // don't include the null terminator in data
+ source.setData(data);
//debug("PARSING(%s) LEN(%d)",szString.utf8().data(),szString.utf8().length());
QXmlSimpleReader reader;
reader.setContentHandler(&handler);