summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/lib7z_facade.cpp
diff options
context:
space:
mode:
authorKarsten Heimrich <karsten.heimrich@theqtcompany.com>2015-06-24 18:03:04 +0200
committerKarsten Heimrich <karsten.heimrich@theqtcompany.com>2015-06-25 15:33:19 +0000
commit8d0d8397f17cbdbdb7f0cde750887ac0b9e1ba84 (patch)
tree820ac29b39f09a3b7cabbec1153a57cd3e3a2564 /src/libs/installer/lib7z_facade.cpp
parent0a229c256cfdc69e4209bc34290a8b657fa6fc6c (diff)
Fix missing filename conversion on UNIX systems.
Task-number: QTIFW-643 Change-Id: If6df557d09b23dce99caed8f7b00dd726a6d42e6 Reviewed-by: Niels Weber <niels.weber@theqtcompany.com> Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Diffstat (limited to 'src/libs/installer/lib7z_facade.cpp')
-rw-r--r--src/libs/installer/lib7z_facade.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libs/installer/lib7z_facade.cpp b/src/libs/installer/lib7z_facade.cpp
index e68064204..cca05ea4c 100644
--- a/src/libs/installer/lib7z_facade.cpp
+++ b/src/libs/installer/lib7z_facade.cpp
@@ -79,6 +79,9 @@ HINSTANCE g_hInstance = 0;
# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
# define FILE_ATTRIBUTE_UNIX_EXTENSION 0x8000 /* trick for Unix */
#else
+extern "C" int global_use_utf16_conversion;
+
+#include <myWindows/config.h>
#include <sys/stat.h>
#endif
@@ -142,6 +145,18 @@ void initSevenZ()
NArchive::NSplit::registerArcSplit();
NArchive::NLzma::NLzmaAr::registerArcLzma();
NArchive::NLzma::NLzma86Ar::registerArcLzma86();
+
+#ifndef Q_OS_WIN
+# ifdef ENV_HAVE_LOCALE
+ const QByteArray locale = qgetenv("LC_ALL").toUpper();
+ if (!locale.isEmpty() && (locale != "C") && (locale != "POSIX"))
+ global_use_utf16_conversion = 1;
+# elif defined(LOCALE_IS_UTF8)
+ global_use_utf16_conversion = 1;
+# else
+ global_use_utf16_conversion = 0;
+# endif
+#endif
});
}