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

Attempt to use wc_str() even if wxWidgets is not built with Unicode.

According to the wxWidgets documentation, it works. But of course, you
don't want to trust the wxWidgets documentation, particularly when it
deals with characters encoding. Or rather, you'd like to trust the
documentation, but you can't trust the actual implementation to work
until you tested it.

So lets see if it works, and revert commit it tomorrow if it sucks.
parent 82ea3c0e
......@@ -86,13 +86,18 @@ DECLARE_LOCAL_EVENT_TYPE( wxEVT_INTF, 1 );
*/
#define wxL2U(utf8) wxU(utf8)
#if wxUSE_UNICODE
# 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
/*
* wxFromLocale() is a replacement for LibVLC FromLocale() that accepts
* a wxString. It was originally introduced because wxString::mb_str()
* sucks on Linux with Unicode wxWidgets.
*
* Another advantage of this approach is that we should be able to catch
* non-ANSI characters on Windows through wxString::wc_str(); while they
* are lost when using mb_str(). This is particularly useful to open
* files whose names contain non-ACP characters.
*/
#define wxFromLocale(wxstring) FromWide(wxstring.wc_str())
#define wxLocaleFree(string) free(string)
/* From Locale functions to use for File Drop targets ... go figure */
#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