aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/UniConversion.h
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2012-05-26 12:08:06 +1000
committernyamatongwe <devnull@localhost>2012-05-26 12:08:06 +1000
commita6598d01d00e24f8c0ee2f4e9cc9036dd447c15f (patch)
tree31d920448268b4398b70b5e3adb54b5fa5900a35 /src/UniConversion.h
parent9be362c7c8a4d2bac76892bc48dd0c54522406fe (diff)
downloadscintilla-mirror-a6598d01d00e24f8c0ee2f4e9cc9036dd447c15f.tar.gz
Move classification of UTF-8 byte sequences into UniConversion module.
Diffstat (limited to 'src/UniConversion.h')
-rw-r--r--src/UniConversion.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/UniConversion.h b/src/UniConversion.h
index 2de2ef3fe..6793221cf 100644
--- a/src/UniConversion.h
+++ b/src/UniConversion.h
@@ -11,3 +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);
+inline bool UTF8IsTrailByte(int ch) {
+ return (ch >= 0x80) && (ch < 0xc0);
+}
+
+enum { UTF8MaskWidth=0x7, UTF8MaskInvalid=0x8 };
+int UTF8Classify(const unsigned char *us, int len);