diff options
Diffstat (limited to 'gtk/PlatGTK.cxx')
-rw-r--r-- | gtk/PlatGTK.cxx | 8 |
1 files 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() { |