From 574a636640d0c4d791ae313d391276e6b3be3b13 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Wed, 12 Nov 2014 07:43:06 +0000 Subject: [PATCH] fix creating wxFont with non-ascii name, closes #16671 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@78141 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/gtk/fontpicker.h | 2 +- src/gtk/control.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/wx/gtk/fontpicker.h b/include/wx/gtk/fontpicker.h index 65bb5c9593..606f944152 100644 --- a/include/wx/gtk/fontpicker.h +++ b/include/wx/gtk/fontpicker.h @@ -52,7 +52,7 @@ protected: public: // used by the GTK callback only void SetNativeFontInfo(const char *gtkdescription) - { m_selectedFont.SetNativeFontInfo(wxString::FromAscii(gtkdescription)); } + { m_selectedFont.SetNativeFontInfo(wxString::FromUTF8(gtkdescription)); } private: DECLARE_DYNAMIC_CLASS(wxFontButton) diff --git a/src/gtk/control.cpp b/src/gtk/control.cpp index 30409cd133..3352965683 100644 --- a/src/gtk/control.cpp +++ b/src/gtk/control.cpp @@ -301,8 +301,10 @@ wxControl::GetDefaultAttributesFromGTKWidget(GtkWidget* widget, if (!font_name) attr.font = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT ); else - attr.font = wxFont(wxString::FromAscii(font_name)); - g_free (font_name); + { + attr.font = wxFont(wxString::FromUTF8(font_name)); + g_free(font_name); + } } if (tlw)