Remove wxLOCALE_CONV_ENCODING flag.

This doesn't affect Unicode builds, only the legacy ANSI one.

PO files are now always converted to the appropriate charset according
to current locale. This was the default behavior for long time; not
doing the conversion was always a fragile hack that didn't work well.
Removing this flag simplifies wxLocale code.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63993 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2010-04-16 11:29:22 +00:00
parent f30bd8f262
commit 3acf8a8d9b
8 changed files with 63 additions and 90 deletions

View File

@@ -409,8 +409,11 @@ enum wxLocaleInfo
enum wxLocaleInitFlags
{
wxLOCALE_DONT_LOAD_DEFAULT = 0x0000, // don't load wxwin.mo
wxLOCALE_LOAD_DEFAULT = 0x0001, // load wxwin.mo?
wxLOCALE_CONV_ENCODING = 0x0002 // convert encoding on the fly?
wxLOCALE_LOAD_DEFAULT = 0x0001 // load wxwin.mo?
#if WXWIN_COMPATIBILITY_2_8
,wxLOCALE_CONV_ENCODING = 0x0002 // no longer used, simply remove
// it from the existing code
#endif
};
class WXDLLIMPEXP_BASE wxLocale
@@ -426,8 +429,11 @@ public:
wxLocale(const wxString& name, // name (for messages)
const wxString& shortName = wxEmptyString, // dir prefix (for msg files)
const wxString& locale = wxEmptyString, // locale (for setlocale)
bool bLoadDefault = true, // preload wxstd.mo?
bool bConvertEncoding = false) // convert Win<->Unix if necessary?
bool bLoadDefault = true // preload wxstd.mo?
#if WXWIN_COMPATIBILITY_2_8
,bool bConvertEncoding = true // convert Win<->Unix if necessary?
#endif
)
{
DoCommonInit();
@@ -435,7 +441,7 @@ public:
}
wxLocale(int language, // wxLanguage id or custom language
int flags = wxLOCALE_LOAD_DEFAULT | wxLOCALE_CONV_ENCODING)
int flags = wxLOCALE_LOAD_DEFAULT)
{
DoCommonInit();
@@ -446,12 +452,15 @@ public:
bool Init(const wxString& name,
const wxString& shortName = wxEmptyString,
const wxString& locale = wxEmptyString,
bool bLoadDefault = true,
bool bConvertEncoding = false);
bool bLoadDefault = true
#if WXWIN_COMPATIBILITY_2_8
,bool bConvertEncoding = true
#endif
);
// same as second ctor (returns true on success)
bool Init(int language = wxLANGUAGE_DEFAULT,
int flags = wxLOCALE_LOAD_DEFAULT | wxLOCALE_CONV_ENCODING);
int flags = wxLOCALE_LOAD_DEFAULT);
// restores old locale
virtual ~wxLocale();
@@ -592,8 +601,6 @@ private:
wxMsgCatalog *m_pMsgCat; // pointer to linked list of catalogs
bool m_bConvertEncoding;
bool m_initialized;
static wxLanguageInfoArray *ms_languagesDB;