Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
212e1467
Commit
212e1467
authored
Mar 21, 2006
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A bit explanation of the wxWidgets string conversion mess won't harm
parent
51501a62
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
12 deletions
+30
-12
modules/gui/wxwidgets/wxwidgets.hpp
modules/gui/wxwidgets/wxwidgets.hpp
+30
-12
No files found.
modules/gui/wxwidgets/wxwidgets.hpp
View file @
212e1467
...
...
@@ -69,26 +69,44 @@ DECLARE_LOCAL_EVENT_TYPE( wxEVT_INTF, 1 );
* I18N macros
***************************************************************************/
/* wxU is used to convert ansi/utf8 strings to unicode strings (wchar_t) */
#if defined( ENABLE_NLS )
/*
* wxU() is used to convert UTF-8 strings (typically from gettext)
* to unicode strings (wchar_t).
*/
#if wxUSE_UNICODE
# define wxU(utf8) wxString(utf8, wxConvUTF8)
#else
# define wxU(utf8) wxString(wxConvUTF8.cMB2WC(utf8), *wxConvCurrent)
#endif
#else // ENABLE_NLS
#if wxUSE_UNICODE
# define wxU(ansi) wxString(ansi, wxConvLocal)
#else
# define wxU(ansi) (ansi)
#endif
#endif
/* wxL2U (locale to unicode) is used to convert ansi strings to unicode
* strings (wchar_t) */
#define wxL2U(ansi) wxU(ansi)
/*
* wxL2U() use to convert localized “data” strings (while wxU() would convert
* strings from gettext messages). Nowadays, the core use UTF-8 internally
* and wxL2U() is only an obsoloted name for wxU().
*/
#define wxL2U(utf8) wxU(utf8)
#if wxUSE_UNICODE
/*
* Whoops, we assume that wchar_t is 32-bits and wide character encoding is
* UTF-32 (ok, both assumptions should de identical). This is not true on all
* platforms.
*
* On Windows, and possibly some other operating systems wchar_t is 16-bits,
* which means code points outside the Basic Multilingual Plane are encoded
* with surrogates as two subsequent wchar_t.
*/
# ifdef WIN32
/*
* Removing this #error without fixing the underlying problem is stricly
* FORBIDDEN. It would result in a _really_ completely unusable wxWidgets
* interface: all string operations would fail.
*
* Corrolary: Think twice, if not more, before you compile wxWidgets with
* Unicode on Windows.
*/
# error FIXME: this is not **REALLY** going to work at all.
# endif
# define wxFromLocale(wxstring) FromUTF32(wxstring.wc_str())
# define wxLocaleFree(string) free(string)
#else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment