diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2009-04-23 15:32:19 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2009-04-23 15:32:19 +0000 |
| commit | 813d295e8a453fccaf5b7acfb55c7c07388bf731 (patch) | |
| tree | 88227f9c935597cf141e1eec0c808b858264b643 /src/Fl_Input_.cxx | |
| parent | a8fdff552b1c59cd2f12541f92c6db249a9fa02e (diff) | |
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
Diffstat (limited to 'src/Fl_Input_.cxx')
| -rw-r--r-- | src/Fl_Input_.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
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$". // |
