try to deal more gracefully (than simply not showing anything at all) with invalid UTF-8 strings (e.g. ISO-8859-1 strings inserted in controls with default (UTF-8) font

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40800 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-08-24 17:50:10 +00:00
parent a6e8c584db
commit 27dee9ae02
2 changed files with 39 additions and 14 deletions

View File

@@ -846,7 +846,9 @@ void wxTextCtrl::SetValue( const wxString &value )
const wxCharBuffer buffer(wxGTK_CONV_ENC(value, GetTextEncoding()));
if ( !buffer )
{
// what else can we do? at least don't crash...
// see comment in WriteText() as to why we must warn the user about
// this
wxLogWarning(_("Failed to set text in the text control."));
return;
}