From: Václav Slavík Date: Thu, 14 Jun 2007 05:54:26 +0000 (+0000) Subject: fixed wxComboBox::Replace() to correctly use UTF-8 string even in ANSI build and... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/37a4076eb5f463c310ebbd91c9b3cb4a6fdd4459?ds=inline fixed wxComboBox::Replace() to correctly use UTF-8 string even in ANSI build and to compile with wxUSE_STL=1 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46462 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/gtk/combobox.cpp b/src/gtk/combobox.cpp index 00792deb14..7fb0ce2424 100644 --- a/src/gtk/combobox.cpp +++ b/src/gtk/combobox.cpp @@ -1117,12 +1117,13 @@ void wxComboBox::Replace( long from, long to, const wxString& value ) if (value.IsNull()) return; gint pos = (gint)to; -#if wxUSE_UNICODE - wxCharBuffer buffer = wxConvUTF8.cWX2MB( value ); - gtk_editable_insert_text( GTK_EDITABLE(entry), (const char*) buffer, strlen( (const char*) buffer ), &pos ); +#if wxUSE_UNICODE_UTF8 + const char *utf8 = value.utf8_str(); #else - gtk_editable_insert_text( GTK_EDITABLE(entry), value.c_str(), value.length(), &pos ); + wxCharBuffer buffer(value.utf8_str()); + char char *utf8 = buffer; #endif + gtk_editable_insert_text(GTK_EDITABLE(entry), utf8, strlen(utf8), &pos); } void wxComboBox::SetSelection( long from, long to )