git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45787
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
{
wxArgNormalizerUtf8(const char* s)
{
- // FIXME-UTF8: optimize this if current locale is UTF-8 one
-
- // convert to widechar string first:
- wxWCharBuffer buf(wxConvLibc.cMB2WC(s));
-
- // then to UTF-8:
- if ( buf )
- m_value = wxConvUTF8.cWC2MB(buf);
+ if ( wxLocaleIsUtf8 )
+ {
+ m_value = wxCharBuffer::CreateNonOwned(s);
+ }
+ else
+ {
+ // convert to widechar string first:
+ wxWCharBuffer buf(wxConvLibc.cMB2WC(s));
+
+ // then to UTF-8:
+ if ( buf )
+ m_value = wxConvUTF8.cWC2MB(buf);
+ }
}
};