diff --git a/rbutil/rbutilqt/base/ttssapi.cpp b/rbutil/rbutilqt/base/ttssapi.cpp index 320ee1191a..d2d8cf801a 100644 --- a/rbutil/rbutilqt/base/ttssapi.cpp +++ b/rbutil/rbutilqt/base/ttssapi.cpp @@ -143,7 +143,11 @@ bool TTSSapi::start(QString *errStr) } voicestream = new QTextStream(voicescript); +#if QT_VERSION < 0x060000 voicestream->setCodec("UTF16-LE"); +#else + voicestream->setEncoding(QStringConverter::Utf16LE); +#endif m_started = true; return true; diff --git a/rbutil/rbutilqt/base/voicefile.cpp b/rbutil/rbutilqt/base/voicefile.cpp index 814ac538e2..ec9ecbed33 100644 --- a/rbutil/rbutilqt/base/voicefile.cpp +++ b/rbutil/rbutilqt/base/voicefile.cpp @@ -217,7 +217,11 @@ void VoiceFileCreator::create(void) //read in downloaded file emit logItem(tr("Reading strings..."),LOGINFO); QTextStream in(&genlang); +#if QT_VERSION < 0x060000 in.setCodec("UTF-8"); +#else + in.setEncoding(QStringConverter::Utf8); +#endif QString id, voice; bool idfound = false; bool voicefound=false; diff --git a/rbutil/rbutilqt/gui/changelog.cpp b/rbutil/rbutilqt/gui/changelog.cpp index 54d6fa6f6c..79d601e412 100644 --- a/rbutil/rbutilqt/gui/changelog.cpp +++ b/rbutil/rbutilqt/gui/changelog.cpp @@ -45,7 +45,11 @@ QString Changelog::parseChangelogFile(QString filename) QFile changelog(filename); changelog.open(QIODevice::ReadOnly); QTextStream c(&changelog); +#if QT_VERSION < 0x060000 c.setCodec(QTextCodec::codecForName("UTF-8")); +#else + c.setEncoding(QStringConverter::Utf8); +#endif QString text; while(!c.atEnd()) { QString line = c.readLine(); diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp index 5a39e8ab9a..60f517825d 100644 --- a/rbutil/rbutilqt/rbutilqt.cpp +++ b/rbutil/rbutilqt/rbutilqt.cpp @@ -292,7 +292,11 @@ void RbUtilQt::about() QFile credits(":/docs/CREDITS"); credits.open(QIODevice::ReadOnly); QTextStream r(&credits); +#if QT_VERSION < 0x060000 r.setCodec(QTextCodec::codecForName("UTF-8")); +#else + r.setEncoding(QStringConverter::Utf8); +#endif while(!r.atEnd()) { QString line = r.readLine(); // filter out header.