From 49f617fcbd80165321c4ccae9f3b1b95eeec2ab6 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Mon, 18 Apr 2005 07:11:07 +0000 Subject: Make code work as documented by treating -1 as special length for encoding as UTF-8 rather than 0. --- gtk/ScintillaGTK.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index 2dade05aa..fa268b2cf 100644 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -833,7 +833,7 @@ int ScintillaGTK::TargetAsUTF8(char *text) { // Translates a nul terminated UTF8 string into the document encoding. // Return the length of the result in bytes. int ScintillaGTK::EncodedFromUTF8(char *utf8, char *encoded) { - int inputLength = lengthForEncode ? lengthForEncode : strlen(utf8); + int inputLength = (lengthForEncode >= 0) ? lengthForEncode : strlen(utf8); if (IsUnicodeMode()) { if (encoded) { memcpy(encoded, utf8, inputLength); -- cgit v1.2.3