From 032a0017a6e992fc40790214c738dbc59c084dea Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sat, 26 May 2012 12:17:54 +1000 Subject: Optimize UTF-8 character length calculations by using an array. --- src/UniConversion.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/UniConversion.h') diff --git a/src/UniConversion.h b/src/UniConversion.h index 6793221cf..87cc43f77 100644 --- a/src/UniConversion.h +++ b/src/UniConversion.h @@ -11,6 +11,9 @@ unsigned int UTF8CharLength(unsigned char ch); unsigned int UTF16Length(const char *s, unsigned int len); unsigned int UTF16FromUTF8(const char *s, unsigned int len, wchar_t *tbuf, unsigned int tlen); +extern int UTF8BytesOfLead[256]; +void UTF8BytesOfLeadInitialise(); + inline bool UTF8IsTrailByte(int ch) { return (ch >= 0x80) && (ch < 0xc0); } -- cgit v1.2.3