From 2381d2ba1aea94f802a5be6f4554e17abf239901 Mon Sep 17 00:00:00 2001 From: David Sansome Date: Wed, 2 Jun 2010 21:04:03 +0000 Subject: [PATCH] Use UTF8 explicitly rather than the local 8-bit codec --- src/playlistparsers/m3uparser.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/playlistparsers/m3uparser.cpp b/src/playlistparsers/m3uparser.cpp index 868f5b5e3..bca4efcca 100644 --- a/src/playlistparsers/m3uparser.cpp +++ b/src/playlistparsers/m3uparser.cpp @@ -29,11 +29,11 @@ SongList M3UParser::Load(QIODevice* device, const QDir& dir) const { M3UType type = STANDARD; Metadata current_metadata; - QString line = QString::fromLocal8Bit(device->readLine()).trimmed(); + QString line = QString::fromUtf8(device->readLine()).trimmed(); if (line.startsWith("#EXTM3U")) { // This is in extended M3U format. type = EXTENDED; - line = QString::fromLocal8Bit(device->readLine()).trimmed(); + line = QString::fromUtf8(device->readLine()).trimmed(); } forever { @@ -65,7 +65,7 @@ SongList M3UParser::Load(QIODevice* device, const QDir& dir) const { if (device->atEnd()) { break; } - line = QString::fromLocal8Bit(device->readLine()).trimmed(); + line = QString::fromUtf8(device->readLine()).trimmed(); } return ret; @@ -101,8 +101,8 @@ void M3UParser::Save(const SongList &songs, QIODevice *device, const QDir &dir) continue; } QString meta = QString("#EXTINF:%1,%2 - %3\n").arg(song.length()).arg(song.artist()).arg(song.title()); - device->write(meta.toLocal8Bit()); - device->write(MakeRelativeTo(song.filename(), dir).toLocal8Bit()); + device->write(meta.toUtf8()); + device->write(MakeRelativeTo(song.filename(), dir).toUtf8()); device->write("\n"); } }