From 90a2fdb00b92e8338ef9b32b889aadbf31ed0acf Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sat, 17 Apr 2004 02:08:39 +0000 Subject: Fix copy of ASCII text to clipboard. --- gtk/ScintillaGTK.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'gtk') diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index d75072d27..30bc88d97 100644 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -1443,9 +1443,11 @@ void ScintillaGTK::GetSelection(GtkSelectionData *selection_data, guint info, Se // Convert text to utf8 if it isn't already if (text->characterSet != SC_CP_UTF8) { const char *charSet = ::CharacterSetID(text->characterSet); - size_t new_len; - char* tmputf = ConvertText(&new_len, text->s, text->len, "UTF-8", charSet); - text->Set(tmputf, new_len, SC_CP_UTF8, text->rectangular); + if (*charSet) { + size_t new_len; + char* tmputf = ConvertText(&new_len, text->s, text->len, "UTF-8", charSet); + text->Set(tmputf, new_len, SC_CP_UTF8, text->rectangular); + } } // Here is a somewhat evil kludge. -- cgit v1.2.3