summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorLPFaint99 <lpfaint99@gmail.com>2011-01-20 06:05:52 +0000
committerLPFaint99 <lpfaint99@gmail.com>2011-01-20 06:05:52 +0000
commit58cb35fe0178ab2ede898f68672fbc99b2eb737e (patch)
treeafcefa34fa7b4caff011b7b41108464d24a70727 /Source/Core
parent7b3e58b6655c2281c0160aa8ab6c8e67293ff9ad (diff)
Fix for the error Cannot Convert from charset Windows Japanese cp 932
caused by logwindow initializing the sjisconv in its constructor on systems which do not have the codepage installed (vlite) fixes issue 3659 git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6887 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/DolphinWX/Src/LogWindow.cpp11
-rw-r--r--Source/Core/DolphinWX/Src/LogWindow.h2
2 files changed, 8 insertions, 5 deletions
diff --git a/Source/Core/DolphinWX/Src/LogWindow.cpp b/Source/Core/DolphinWX/Src/LogWindow.cpp
index 3cba51a54e..cc8651424a 100644
--- a/Source/Core/DolphinWX/Src/LogWindow.cpp
+++ b/Source/Core/DolphinWX/Src/LogWindow.cpp
@@ -21,6 +21,7 @@
#include "IniFile.h"
#include "FileUtil.h"
#include "DebuggerUIUtil.h"
+#include <wx/fontmap.h>
// Milliseconds between msgQueue flushes to wxTextCtrl
#define UPDATETIME 200
@@ -48,12 +49,13 @@ CLogWindow::CLogWindow(CFrame *parent, wxWindowID id, const wxPoint& pos,
, Parent(parent) , m_LogAccess(true)
, m_Log(NULL), m_cmdline(NULL), m_FontChoice(NULL)
, m_LogSection(1)
+{
#ifdef _WIN32
- , m_SJISConv(wxFONTENCODING_SHIFT_JIS)
+ m_SJISConv = new wxCSConv(wxFontMapper::GetEncodingName(wxFONTENCODING_SHIFT_JIS));
#else
- , m_SJISConv(wxFONTENCODING_EUC_JP)
+ m_SJISConv = new wxCSConv(wxFontMapper::GetEncodingName(wxFONTENCODING_EUC_JP));
#endif
-{
+
m_LogManager = LogManager::GetInstance();
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i)
m_LogManager->addListener((LogTypes::LOG_TYPE)i, this);
@@ -157,6 +159,7 @@ CLogWindow::~CLogWindow()
}
m_LogTimer->Stop();
delete m_LogTimer;
+ delete m_SJISConv;
}
void CLogWindow::OnClose(wxCloseEvent& event)
@@ -537,6 +540,6 @@ void CLogWindow::Log(LogTypes::LOG_LEVELS level, const char *text)
m_LogSection.Enter();
if (msgQueue.size() >= 100)
msgQueue.pop();
- msgQueue.push(std::pair<u8, wxString>((u8)level, wxString(text, m_SJISConv)));
+ msgQueue.push(std::pair<u8, wxString>((u8)level, wxString(text, *m_SJISConv)));
m_LogSection.Leave();
}
diff --git a/Source/Core/DolphinWX/Src/LogWindow.h b/Source/Core/DolphinWX/Src/LogWindow.h
index 57db6e14f7..71b9f89ad7 100644
--- a/Source/Core/DolphinWX/Src/LogWindow.h
+++ b/Source/Core/DolphinWX/Src/LogWindow.h
@@ -85,7 +85,7 @@ private:
Common::CriticalSection m_LogSection;
- wxCSConv m_SJISConv;
+ wxCSConv* m_SJISConv;
DECLARE_EVENT_TABLE()