diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2011-09-20 22:26:46 +0200 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2011-09-20 22:26:46 +0200 |
commit | 3890bae14e87574efb150f791db6dbd446d9fb57 (patch) | |
tree | 5fe679bb623dacefa23212ecc59ce87ea5cc32e5 /src/PSEditText.cxx | |
parent | 232a37d54de6ae87663bde2b3a886dccc0f3fcba (diff) |
bring in utf8 changes from fltk2 branch
Diffstat (limited to 'src/PSEditText.cxx')
-rw-r--r-- | src/PSEditText.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/PSEditText.cxx b/src/PSEditText.cxx index 5fa39ff..bfb5e27 100644 --- a/src/PSEditText.cxx +++ b/src/PSEditText.cxx @@ -1,5 +1,5 @@ // -// Copyright 2007-2009 Johannes Hofmann <Johannes.Hofmann@gmx.de> +// Copyright 2007 Johannes Hofmann <Johannes.Hofmann@gmx.de> // // This software may be used and distributed according to the terms // of the GNU General Public License, incorporated herein by reference. @@ -9,6 +9,7 @@ #include <unistd.h> #include <stdlib.h> #include <errno.h> +#include <FL/fl_utf8.h> #include "PSEditText.H" @@ -52,7 +53,9 @@ void PSEditText::append_text(const char*s1) { void PSEditText::rm_char() { if (s && strlen(s) > 0) { - s[strlen(s) - 1] = '\0'; + char *t; + t = (char*)fl_utf8back(s + strlen(s) - 1, s, s + strlen(s)); + t[0] = '\0'; } } |