From 7b8f6edff5915289dbd13a085afdaf7fcfc73560 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Soutad=C3=A9?= Date: Wed, 16 Nov 2011 15:47:49 +0100 Subject: [PATCH] Fix two bugs : * ESCAPE_CHARS and UNESCAPE_CHARS were incomplete * Enable utf8 for widgets --- src/controller/KissCount.cpp | 2 ++ src/controller/KissCount.hpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/controller/KissCount.cpp b/src/controller/KissCount.cpp index 29b7119..3c82d51 100644 --- a/src/controller/KissCount.cpp +++ b/src/controller/KissCount.cpp @@ -30,6 +30,8 @@ std::vector * KissCount::_exportEngines; KissCount::KissCount(int argc, char** argv) : QApplication(argc, argv), _user(0) { + QTextCodec::setCodecForCStrings(QTextCodec::codecForName("utf8")); + _wxUI = new wxUI(this, "KissCount"); //_wxUI->SetLanguage(wxLocale::GetSystemLanguage()); diff --git a/src/controller/KissCount.hpp b/src/controller/KissCount.hpp index a4f2c9d..53510af 100644 --- a/src/controller/KissCount.hpp +++ b/src/controller/KissCount.hpp @@ -32,7 +32,7 @@ #define APP_VERSION "0.3" -#define ESCAPE_CHARS(s) s = s.replace("\"", "\\\""); +#define ESCAPE_CHARS(s) s = s.replace("\"", "\\\""); s = s.replace("\'", "\\\'"); /*{ \ if (s.Find(wxT("\\\"")) == wxNOT_FOUND) \ s.Replace(wxT("\""), wxT("\\\""), true); \ @@ -40,7 +40,7 @@ s.Replace(wxT("\'"), wxT("\\\'"), true); \ } */ -#define UNESCAPE_CHARS(s) s = s.replace("\\\"", "\""); +#define UNESCAPE_CHARS(s) s = s.replace("\\\"", "\""); s = s.replace("\\\'", "\'"); /*{ \ s.Replace(wxT("\\\""), wxT("\""), true); \ s.Replace(wxT("\\\'"), wxT("\'"), true); \