Commit ba96f5e2 authored by Christophe Mutricy's avatar Christophe Mutricy

Fix memory corruption in wx locales handling on UTF8 system with iconv

parent 21b9dcdc
...@@ -91,7 +91,7 @@ DECLARE_LOCAL_EVENT_TYPE( wxEVT_INTF, 1 ); ...@@ -91,7 +91,7 @@ DECLARE_LOCAL_EVENT_TYPE( wxEVT_INTF, 1 );
* a wxString. * a wxString.
* *
* Note that if you want to use non-ANSI code page characters on Windows, * Note that if you want to use non-ANSI code page characters on Windows,
* you MUST build WxWidgets in “Unicode” mode. * you MUST build WxWidgets in “Unicode” mode. wxConvUTF8
*/ */
static inline char *wxFromLocale (const wxString& string) static inline char *wxFromLocale (const wxString& string)
{ {
...@@ -100,8 +100,8 @@ static inline char *wxFromLocale (const wxString& string) ...@@ -100,8 +100,8 @@ static inline char *wxFromLocale (const wxString& string)
return FromWide ((const wchar_t *)string.c_str()); return FromWide ((const wchar_t *)string.c_str());
# define wxLocaleFree free # define wxLocaleFree free
# else # else
return FromLocale (string.mb_str()); return FromLocaleDup (string.mb_str());
# define wxLocaleFree LocaleFree # define wxLocaleFree free
# endif # endif
#else #else
# warning Please use WxWidgets with Unicode. # warning Please use WxWidgets with Unicode.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment