From 59ff00754ba25c1cb1d9e46797d1ac4a8027aa9a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 21 Jul 2011 16:33:19 +0200 Subject: [PATCH] unset the codec for c string conversion. The system one is used instead --- src/core/main.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/core/main.cpp b/src/core/main.cpp index 06bbad5f..4822c69e 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -73,10 +73,16 @@ int main(int argc, char *argv[]) #endif UBApplication app("Sankore 3.1", argc, argv); - - QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8")); - QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8")); - QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); + + //BUGFIX: + //when importing a sankore file that contains a non standard character + //the codecForLocale or the codecForCString is used to convert the file path + //into a const char*. This is why in french windows setup the codec name shouldn't be + //set to UTF-8. For example, setting UTF-8, will convert "Haïti" into "HaÂ-ti. + + QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8")); + //QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8")); + QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); QStringList args = app.arguments();