From 813d295e8a453fccaf5b7acfb55c7c07388bf731 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Thu, 23 Apr 2009 15:32:19 +0000 Subject: Fixed Fl_Input_::index(int) to return a UCS4 character instead of a byte. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6777 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Input_.cxx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src') diff --git a/src/Fl_Input_.cxx b/src/Fl_Input_.cxx index 8f5f69e0b..60ec85289 100644 --- a/src/Fl_Input_.cxx +++ b/src/Fl_Input_.cxx @@ -1239,6 +1239,21 @@ int Fl_Input_::linesPerPage() { return n; } +/** + Returns the character at index \p i. + + This function returns the utf8 character at \p i + as a ucs4 character code. + + \param [in] i index into the value field + \return the character at index \p i +*/ +Fl_Char Fl_Input_::index(int i) const +{ + int len = 0; + return fl_utf8decode(value_+i, value_+size_, &len); +} + // // End of "$Id$". // -- cgit v1.2.3