From 1bac8a0ccae1f8993714e795d7da2e78245182d2 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Mon, 6 Dec 2010 18:22:22 +0000 Subject: Fixed crashes when Fl_Text_* detects illegal UTF 8 sequences. Widgets will not do any further processing but just jump over the character. Screen representation depends largely on whatever the underlying OS does with those sequences, but I feel that this is out of the scope of this library. (STR 2348) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7965 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- FL/fl_utf8.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'FL/fl_utf8.h') diff --git a/FL/fl_utf8.h b/FL/fl_utf8.h index fd54b3350..22f8ade0b 100644 --- a/FL/fl_utf8.h +++ b/FL/fl_utf8.h @@ -99,13 +99,16 @@ FL_EXPORT int fl_utf8bytes(unsigned ucs); /* OD: returns the byte length of the first UTF-8 char sequence (returns -1 if not valid) */ FL_EXPORT int fl_utf8len(char c); - + +/* OD: returns the byte length of the first UTF-8 char sequence (returns +1 if not valid) */ +FL_EXPORT int fl_utf8len1(char c); + /* OD: returns the number of Unicode chars in the UTF-8 string */ FL_EXPORT int fl_utf_nb_char(const unsigned char *buf, int len); /* F2: Convert the next UTF8 char-sequence into a Unicode value (and say how many bytes were used) */ FL_EXPORT unsigned fl_utf8decode(const char* p, const char* end, int* len); - + /* F2: Encode a Unicode value into a UTF8 sequence, return the number of bytes used */ FL_EXPORT int fl_utf8encode(unsigned ucs, char* buf); -- cgit v1.2.3