From f15fa3a93ffd477077d1255ebd9d6335758021c4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 28 Sep 2005 09:41:55 +0000 Subject: [PATCH] fix for a crash due to using NULL inputConv in Unicode build introduced in rev 1.162 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35751 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/intl.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/common/intl.cpp b/src/common/intl.cpp index 31332b83ba..911dfaa146 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -1254,14 +1254,23 @@ void wxMsgCatalogFile::FillHash(wxMessagesHash& hash, if ( convertEncoding ) { if ( m_charset.empty() ) + { inputConv = wxConvCurrent; + } else + { inputConv = csConv = new wxCSConv(m_charset); + } } - else // no conversion needed + else // no need to convert the encoding { + // we still need the conversion for Unicode build +#if wxUSE_UNICODE + inputConv = wxConvCurrent; +#else // !wxUSE_UNICODE inputConv = NULL; +#endif // wxUSE_UNICODE/!wxUSE_UNICODE } // conversion to apply to msgid strings before looking them up: we only @@ -1315,11 +1324,11 @@ void wxMsgCatalogFile::FillHash(wxMessagesHash& hash, wxString msgid(data, *inputConv); #else // ASCII wxString msgid; -#if wxUSE_WCHAR_T - if ( inputConv && sourceConv ) - msgid = wxString(inputConv->cMB2WC(data), *sourceConv); - else -#endif + #if wxUSE_WCHAR_T + if ( inputConv && sourceConv ) + msgid = wxString(inputConv->cMB2WC(data), *sourceConv); + else + #endif msgid = data; #endif // wxUSE_UNICODE -- 2.47.2