- // host native is UTF16
- wxMBConvUTF16BE converter ;
- SetText( converter.cMB2WX( (const char*) buf ) );
+ // normally the data is in UTF-8 so we could use FromUTF8Unchecked()
+ // but it's not absolutely clear what GTK+ does if the clipboard data
+ // is not in UTF-8 so do an extra check for tranquility, it shouldn't
+ // matter much if we lose a bit of performance when pasting from
+ // clipboard
+ m_text = wxString::FromUTF8(buf, len);
+ }
+ else // wxDF_TEXT, convert from current (non-UTF8) locale
+ {
+ m_text = wxConvLocal.cMB2WC(buf, len, NULL);