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
This commit is contained in:
parent
7b3e58b665
commit
58cb35fe01
|
@ -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)
|
||||
#else
|
||||
, m_SJISConv(wxFONTENCODING_EUC_JP)
|
||||
#endif
|
||||
{
|
||||
#ifdef _WIN32
|
||||
m_SJISConv = new wxCSConv(wxFontMapper::GetEncodingName(wxFONTENCODING_SHIFT_JIS));
|
||||
#else
|
||||
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();
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ private:
|
|||
|
||||
Common::CriticalSection m_LogSection;
|
||||
|
||||
wxCSConv m_SJISConv;
|
||||
wxCSConv* m_SJISConv;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
|
|
Loading…
Reference in New Issue