aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/UniConversion.h
diff options
context:
space:
mode:
authornyamatongwe <unknown>2012-05-26 12:08:06 +1000
committernyamatongwe <unknown>2012-05-26 12:08:06 +1000
commitc725c015867e59efd1ebe66e0247b62e38e04ac9 (patch)
tree23fab3f33a74bad1bdf11db10b0166df6379630c /src/UniConversion.h
parent963ef3fb4bbede4090fcca8b7ab7faba72272b01 (diff)
downloadscintilla-mirror-c725c015867e59efd1ebe66e0247b62e38e04ac9.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);