Set the default string encoding to UTF-8

This commit is contained in:
Thomas Goyne 2013-01-29 07:10:35 -08:00
parent 86aca22502
commit 9f7e865196

View file

@ -67,6 +67,7 @@
#include <boost/filesystem/fstream.hpp> #include <boost/filesystem/fstream.hpp>
#include <boost/format.hpp> #include <boost/format.hpp>
#include <boost/locale.hpp>
#include <sstream> #include <sstream>
#include <wx/config.h> #include <wx/config.h>
@ -112,6 +113,10 @@ bool AegisubApp::OnInit() {
SetAppName("aegisub"); SetAppName("aegisub");
#endif #endif
// Set the global locale to the utf-8 version of the current locale
std::locale::global(boost::locale::generator().generate(""));
boost::filesystem::path::imbue(std::locale());
// Pointless `this` capture required due to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51494 // Pointless `this` capture required due to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51494
agi::dispatch::Init([this](agi::dispatch::Thunk f) { agi::dispatch::Init([this](agi::dispatch::Thunk f) {
wxThreadEvent *evt = new wxThreadEvent(EVT_CALL_THUNK); wxThreadEvent *evt = new wxThreadEvent(EVT_CALL_THUNK);