Skip to content
Extraits de code Groupes Projets
Vérifiée Valider c2fd0c1c rédigé par Kubat's avatar Kubat
Parcourir les fichiers

MISC: Explicitly set string codec to UTF-8

parent 8e7c2aba
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!18Implement the VivyDocument specification
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <QIcon> #include <QIcon>
#include <QFontDatabase> #include <QFontDatabase>
#include <locale> #include <locale>
#include <QTextCodec>
using namespace Vivy; using namespace Vivy;
...@@ -35,7 +36,8 @@ VivyApplication::setTheme(Theme theme) noexcept ...@@ -35,7 +36,8 @@ VivyApplication::setTheme(Theme theme) noexcept
int int
VivyApplication::exec() noexcept VivyApplication::exec() noexcept
{ {
// For MPV // For MPV & Qt
QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
std::setlocale(LC_NUMERIC, "C"); std::setlocale(LC_NUMERIC, "C");
// Add fonts // Add fonts
......
#include "VivyCli.hh" #include "VivyCli.hh"
#include <iostream> #include <iostream>
#include <QTextCodec>
using namespace Vivy; using namespace Vivy;
...@@ -13,12 +14,14 @@ VivyCli::VivyCli(int &argc, char **argv) noexcept ...@@ -13,12 +14,14 @@ VivyCli::VivyCli(int &argc, char **argv) noexcept
int int
VivyCli::exec() noexcept VivyCli::exec() noexcept
{ {
QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
if ((selectedDoc == nullptr) || (!scriptStore.executeScript(selectedDoc->getUuid()))) if ((selectedDoc == nullptr) || (!scriptStore.executeScript(selectedDoc->getUuid())))
return 1; return 1;
for (const auto &str : scriptStore.getLoadedModules()) { for (const auto &str : scriptStore.getLoadedModules()) {
std::cout << "Module " << str << " was loaded!\n"; std::cout << "Module " << str << " was loaded!\n";
const auto *mod = scriptStore.getModule(str); [[maybe_unused]] const auto *mod = scriptStore.getModule(str);
} }
return 0; return 0;
} }
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter