Use wxString::utf8_str() and FromUTF8() to convert to and from UTF-8. This is
more efficient than using wxConvUTF8 as the code did before as it avoids the
conversion entirely when wxString uses UTF-8 internally (as it does by default
in wxX11) and also has the advantage of compiling in STL build unlike the old
code.
Closes #12518.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65657
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
#include "wx/x11/private.h"
#include "wx/gtk/private/string.h"
#include "wx/x11/private.h"
#include "wx/gtk/private/string.h"
- #define wxPANGO_CONV(s) (wxConvUTF8.cWX2MB((s)))
- #define wxPANGO_CONV_BACK(s) (wxConvUTF8.cMB2WX((s)))
+ #define wxPANGO_CONV(s) s.utf8_str()
+ #define wxPANGO_CONV_BACK(s) wxString::FromUTF8Unchecked(s)
#endif
// ----------------------------------------------------------------------------
#endif
// ----------------------------------------------------------------------------
PangoLayout *layout = pango_layout_new(m_context);
pango_layout_set_font_description(layout, m_fontdesc);
PangoLayout *layout = pango_layout_new(m_context);
pango_layout_set_font_description(layout, m_fontdesc);
- const wxCharBuffer data = wxConvUTF8.cWC2MB( text );
+ const wxScopedCharBuffer data(text.utf8_str());
pango_layout_set_text(layout, data, data.length());
// Measure layout.
pango_layout_set_text(layout, data, data.length());
// Measure layout.
else
pango_layout_set_font_description(layout, m_fontdesc);
else
pango_layout_set_font_description(layout, m_fontdesc);
- const wxCharBuffer data = wxConvUTF8.cWC2MB( string );
+ const wxScopedCharBuffer data(string.utf8_str());
pango_layout_set_text(layout, data, data.length());
// Measure text.
pango_layout_set_text(layout, data, data.length());
// Measure text.