changeset 189:089f1a13963d

Require (and provide) text codec for output stream -- fixing #1153 (wrong codec used when writing RDF)
author Chris Cannam
date Mon, 02 Mar 2015 17:17:59 +0000
parents cbbf8a838b47
children 2d2253469ca4
files .hgsubstate runner/JAMSFeatureWriter.cpp runner/LabFeatureWriter.cpp
diffstat 3 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/.hgsubstate	Wed Feb 25 10:20:17 2015 +0000
+++ b/.hgsubstate	Mon Mar 02 17:17:59 2015 +0000
@@ -1,4 +1,4 @@
 d16f0fd6db6104d87882bc43788a3bb1b0f8c528 dataquay
 879bdc878826bebec67130326f99397c430419b1 sv-dependency-builds
-88b54a185a0a9b0daeca0efd0bbe22243f4dfbc0 svcore
+d74ebd2d2c4906096870cf49ac0b4f37dabeda29 svcore
 632d90c185ecc8655f7a85ba58dc568351449dfd vamp-plugin-sdk
--- a/runner/JAMSFeatureWriter.cpp	Wed Feb 25 10:20:17 2015 +0000
+++ b/runner/JAMSFeatureWriter.cpp	Mon Mar 02 17:17:59 2015 +0000
@@ -23,6 +23,7 @@
 #include "rdf/PluginRDFIndexer.h"
 
 #include <QFileInfo>
+#include <QTextCodec>
 
 #include "version.h"
 
@@ -97,7 +98,8 @@
 {
     QString transformId = transform.getIdentifier();
 
-    QTextStream *sptr = getOutputStream(trackId, transformId);
+    QTextStream *sptr = getOutputStream
+        (trackId, transformId, QTextCodec::codecForName("UTF-8"));
     if (!sptr) {
         throw FailedToOpenOutputStream(trackId, transformId);
     }
--- a/runner/LabFeatureWriter.cpp	Wed Feb 25 10:20:17 2015 +0000
+++ b/runner/LabFeatureWriter.cpp	Mon Mar 02 17:17:59 2015 +0000
@@ -23,6 +23,7 @@
 
 #include <QRegExp>
 #include <QTextStream>
+#include <QTextCodec>
 
 using namespace std;
 using namespace Vamp;
@@ -85,7 +86,8 @@
 
     TransformId transformId = transform.getIdentifier();
 
-    QTextStream *sptr = getOutputStream(trackId, transformId);
+    QTextStream *sptr = getOutputStream
+        (trackId, transformId, QTextCodec::codecForName("UTF-8"));
     if (!sptr) {
         throw FailedToOpenOutputStream(trackId, transformId);
     }
@@ -121,7 +123,9 @@
          i != m_pending.end(); ++i) {
         DataId tt = i->first;
         Plugin::Feature f = i->second;
-        QTextStream *sptr = getOutputStream(tt.first, tt.second.getIdentifier());
+        QTextStream *sptr = getOutputStream
+            (tt.first, tt.second.getIdentifier(),
+             QTextCodec::codecForName("UTF-8"));
         if (!sptr) {
             throw FailedToOpenOutputStream(tt.first, tt.second.getIdentifier());
         }