aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2004-04-17 02:08:39 +0000
committernyamatongwe <devnull@localhost>2004-04-17 02:08:39 +0000
commit90a2fdb00b92e8338ef9b32b889aadbf31ed0acf (patch)
tree8f9802ee24aeac0e74fe1792c261c136f98830f5
parent780bc12d04448f05dab8c7f5b294997c25c447b3 (diff)
downloadscintilla-mirror-90a2fdb00b92e8338ef9b32b889aadbf31ed0acf.tar.gz
Fix copy of ASCII text to clipboard.
-rw-r--r--gtk/ScintillaGTK.cxx8
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.