Commit a31da2da authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

I knew I was foolish to expect wxWidgets to work properly.

parent c8ad87dd
...@@ -89,15 +89,24 @@ DECLARE_LOCAL_EVENT_TYPE( wxEVT_INTF, 1 ); ...@@ -89,15 +89,24 @@ DECLARE_LOCAL_EVENT_TYPE( wxEVT_INTF, 1 );
/* /*
* wxFromLocale() is a replacement for LibVLC FromLocale() that accepts * wxFromLocale() is a replacement for LibVLC FromLocale() that accepts
* a wxString. It was originally introduced because wxString::mb_str() * a wxString. It was originally introduced because wxString::mb_str()
* sucks on Linux with Unicode wxWidgets. * sucks on Linux with Unicode wxWidgets. It then turned out wxWidgets
* did not support wc_str() when Unicode was not enabled.
* *
* Another advantage of this approach is that we should be able to catch * But heh, that's wxWidgets; you can't really expect it to actually
* non-ANSI characters on Windows through wxString::wc_str(); while they * work, let alone work like its documentation says.
* are lost when using mb_str(). This is particularly useful to open *
* files whose names contain non-ACP characters. * Did it work, we would be able to catch non-ANSI characters on Windows
* through wxString::wc_str(); while they are lost when using mb_str().
* This would be particularly useful to open files whose names contain
* non-ACP characters.
*/ */
#define wxFromLocale(wxstring) FromWide(wxstring.wc_str()) #if wxUSE_UNICODE
#define wxLocaleFree(string) free(string) # define wxFromLocale(wxstring) FromWide(wxstring.wc_str())
# define wxLocaleFree(string) free(string)
#else
# define wxFromLocale(wxstring) FromLocale(wxstring.mb_str())
# define wxLocaleFree(string) LocaleFree(string)
#endif
/* From Locale functions to use for File Drop targets ... go figure */ /* From Locale functions to use for File Drop targets ... go figure */
#ifdef wxUSE_UNICODE #ifdef wxUSE_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