+// (this is same for UTF-8 and Wchar builds, we just convert to wchar_t)
+template<>
+struct wxArgNormalizer<const wxUniChar&> : public wxArgNormalizer<wchar_t>
+{
+ wxArgNormalizer(const wxUniChar& s,
+ const wxFormatString *fmt, unsigned index)
+ : wxArgNormalizer<wchar_t>(s.GetValue(), fmt, index) {}
+};
+
+// for wchar_t, default handler does the right thing
+
+// char has to be treated differently in Unicode builds: a char argument may
+// be used either for a character value (which should be converted into
+// wxUniChar) or as an integer value (which should be left as-is). We take
+// advantage of the fact that both char and wchar_t are converted into int
+// in variadic arguments here.
+#if wxUSE_UNICODE
+template<typename T>
+struct wxArgNormalizerNarrowChar
+{
+ wxArgNormalizerNarrowChar(T value,
+ const wxFormatString *fmt, unsigned index)
+ {
+ // FIXME-UTF8: which one is better default in absence of fmt string
+ // (i.e. when used like e.g. Foo("foo", "bar", 'c', NULL)?
+ if ( !fmt || fmt->GetArgumentType(index) == wxFormatString::Arg_Char )
+ m_value = wx_truncate_cast(T, wxUniChar(value).GetValue());
+ else
+ m_value = value;
+ }
+
+ int get() const { return m_value; }
+
+ T m_value;
+};