From a02d4c8e5a6f514a27875c634035491d52565e9f Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Mon, 13 Jan 2003 10:23:26 +0000 Subject: DBCSCharLength always returns >= 1 as that makes it much easier to use. --- gtk/PlatGTK.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index abcc0d486..7088a5f7e 100644 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -1697,8 +1697,12 @@ bool Platform::IsDBCSLeadByte(int /*codePage*/, char /*ch*/) { return false; } -int Platform::DBCSCharLength(int codePage, const char *s) { - return mblen(s, MB_CUR_MAX) +int Platform::DBCSCharLength(int /*codePage*/, const char *s) { + int bytes = mblen(s, MB_CUR_MAX); + if (bytes >= 1) + return bytes; + else + return 1; } int Platform::DBCSCharMaxLength() { -- cgit v1.2.3