utf8_strlen: Improve performance
commit338f5b5681181c771646b6f225f103be4b14ea03
authorSteve Bennett <steveb@workware.net.au>
Sun, 27 Oct 2019 21:38:22 +0000 (28 07:38 +1000)
committerSteve Bennett <steveb@workware.net.au>
Sun, 27 Oct 2019 21:43:47 +0000 (28 07:43 +1000)
treef5f22e66725e52e6d281ed525f8f6643b22eddc8
parent27ed764fa513ea55f92ea1e6be500fb22b30007b
utf8_strlen: Improve performance

Use utf8_charlen() rather than utf8_tounicode()
Note that utf8_charlen() now returns 1 instead of -1 for an invalid
utf-8 start byte.

Reported-by: dbohdan <dbohdan@dbohdan.com>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
utf8.c
utf8.h