diff options
| author | nyamatongwe <unknown> | 2012-05-26 12:08:06 +1000 |
|---|---|---|
| committer | nyamatongwe <unknown> | 2012-05-26 12:08:06 +1000 |
| commit | c725c015867e59efd1ebe66e0247b62e38e04ac9 (patch) | |
| tree | 23fab3f33a74bad1bdf11db10b0166df6379630c /src/UniConversion.h | |
| parent | 963ef3fb4bbede4090fcca8b7ab7faba72272b01 (diff) | |
| download | scintilla-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.h | 6 |
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); |
