From 7cb06872875266c75de8cf11c668a1dd733d1fcd Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 18 Sep 2005 14:48:17 +0000 Subject: [PATCH] avoid unnecessary conversions when loading the catalog (i.e. if the catalog encoding is the same as the currently used one) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35570 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/intl.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/common/intl.cpp b/src/common/intl.cpp index 1f360d9a5a..fd08730d8e 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -1219,6 +1219,19 @@ void wxMsgCatalogFile::FillHash(wxMessagesHash& hash, const wxString& msgIdCharset, bool convertEncoding) const { +#if wxUSE_FONTMAP + // determine if we need any conversion at all + if ( convertEncoding ) + { + wxFontEncoding encCat = wxFontMapperBase::GetEncodingFromName(m_charset); + if ( encCat == wxLocale::GetSystemEncoding() ) + { + // no need to convert + convertEncoding = false; + } + } +#endif // wxUSE_FONTMAP + #if wxUSE_WCHAR_T wxCSConv *csConv = NULL; if ( !m_charset.empty() ) -- 2.45.2