diff options
author | nyamatongwe <unknown> | 2005-04-18 07:11:07 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2005-04-18 07:11:07 +0000 |
commit | 49f617fcbd80165321c4ccae9f3b1b95eeec2ab6 (patch) | |
tree | e7fa146390f3b34995869268a42c037a0b19c806 | |
parent | f1b2a14f13917702c0d16debb11a20bd3d3ec961 (diff) | |
download | scintilla-mirror-49f617fcbd80165321c4ccae9f3b1b95eeec2ab6.tar.gz |
Make code work as documented by treating -1 as special length for encoding
as UTF-8 rather than 0.
-rw-r--r-- | gtk/ScintillaGTK.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
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); |