diff options
author | nyamatongwe <unknown> | 2004-04-17 02:08:39 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2004-04-17 02:08:39 +0000 |
commit | 32a232e4b01daa4b810b3fc5a265ea819d16a775 (patch) | |
tree | 8f9802ee24aeac0e74fe1792c261c136f98830f5 | |
parent | 58e3e7387aa34c41f95ac8a588705e3d81c11865 (diff) | |
download | scintilla-mirror-32a232e4b01daa4b810b3fc5a265ea819d16a775.tar.gz |
Fix copy of ASCII text to clipboard.
-rw-r--r-- | gtk/ScintillaGTK.cxx | 8 |
1 files changed, 5 insertions, 3 deletions
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. |