1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of global functions
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
9 /** @addtogroup group_funcmacro_string */
13 This macro can be used with character and string literals (in other words,
14 @c 'x' or @c "foo") to automatically convert them to wide strings in Unicode
15 builds of wxWidgets. This macro simply returns the value passed to it
16 without changes in ASCII build. In fact, its definition is:
26 Note that since wxWidgets 2.9.0 you shouldn't use wxT() anymore in your
27 program sources if you want to support Unicode.
29 @see @ref overview_unicode, wxS()
31 @header{wx/chartype.h}
36 wxS is macro which can be used with character and string literals (in other words,
37 @c 'x' or @c "foo") to either convert them to wide characters or wide strings
38 in @c wchar_t-based (UTF-16) builds or keep them unchanged in @c char-based
41 Basically this macro produces characters or strings of type wxStringCharType.
43 The use of this macro is optional as the translation will always be done at
44 run-time even if there is a mismatch between the kind of the literal used
45 and the string or character type used in the current build.
46 However using it can be beneficial in <b>performance-sensitive code</b> to
47 do the conversion at compile-time instead.
49 @see @ref overview_unicode, wxT()
51 @header{wx/chartype.h}
56 This macro is exactly the same as wxT() and is defined in wxWidgets simply
57 because it may be more intuitive for Windows programmers as the standard
58 Win32 headers also define it (as well as yet another name for the same
59 macro which is _TEXT()).
61 Don't confuse this macro with _()!
63 @header{wx/chartype.h}
68 wxChar is defined to be
69 - @c char when <tt>wxUSE_UNICODE==0</tt>
70 - @c wchar_t when <tt>wxUSE_UNICODE==1</tt> (the default).
72 typedef wxUSE_UNICODE_dependent wxChar
;
75 wxSChar is defined to be
76 - <tt>signed char</tt> when <tt>wxUSE_UNICODE==0</tt>
77 - @c wchar_t when <tt>wxUSE_UNICODE==1</tt> (the default).
79 typedef wxUSE_UNICODE_dependent wxSChar
;
82 wxUChar is defined to be
83 - <tt>unsigned char</tt> when <tt>wxUSE_UNICODE==0</tt>
84 - @c wchar_t when <tt>wxUSE_UNICODE==1</tt> (the default).
86 typedef wxUSE_UNICODE_dependent wxUChar
;
89 wxStringCharType is defined to be:
90 - @c char when <tt>wxUSE_UNICODE==0</tt>
91 - @c char when <tt>wxUSE_UNICODE_WCHAR==0</tt> and <tt>wxUSE_UNICODE==1</tt>
92 - @c wchar_t when <tt>wxUSE_UNICODE_WCHAR==1</tt> and <tt>wxUSE_UNICODE==1</tt>
94 The @c wxUSE_UNICODE_WCHAR symbol is defined to @c 1 when building on
95 Windows while it's defined to @c 0 when building on Unix, Linux or OS X.
96 (Note that @c wxUSE_UNICODE_UTF8 symbol is defined as the opposite of
97 @c wxUSE_UNICODE_WCHAR.)
99 Note that wxStringCharType (as the name says) is the type used by wxString
100 for internal storage of the characters.
102 typedef wxUSE_UNICODE_WCHAR_dependent wxStringCharType
;