From 8eb6dfdb02cf7b9d2c92f9e6ef28ad5312415302 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 19 Dec 2013 17:02:34 -0800 Subject: Use QFile::{encode,decode}Name for file names And make them use UTF-8 on Windows instead of the local 8 bit encoding. This will also get us the proper NFD encoding on OS X. Signed-off-by: Thiago Macieira Signed-off-by: Dirk Hohndel --- qt-ui/mainwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'qt-ui/mainwindow.cpp') diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 276f24ba9..5f410ff3c 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -825,7 +825,7 @@ void MainWindow::importFiles(const QStringList fileNames) QByteArray fileNamePtr; char *error = NULL; for (int i = 0; i < fileNames.size(); ++i) { - fileNamePtr = fileNames.at(i).toUtf8(); + fileNamePtr = QFile::encodeName(fileNames.at(i)); parse_file(fileNamePtr.data(), &error); if (error != NULL) { showError(error); @@ -846,7 +846,7 @@ void MainWindow::loadFiles(const QStringList fileNames) QByteArray fileNamePtr; for (int i = 0; i < fileNames.size(); ++i) { - fileNamePtr = fileNames.at(i).toUtf8(); + fileNamePtr = QFile::encodeName(fileNames.at(i)); parse_file(fileNamePtr.data(), &error); set_filename(fileNamePtr.data(), TRUE); setTitle(MWTF_FILENAME); -- cgit v1.2.3-70-g09d2