diff options
| author | Neil <nyamatongwe@gmail.com> | 2015-02-23 10:10:54 +1100 |
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2015-02-23 10:10:54 +1100 |
| commit | c194249102cea0df80bcbe2d154dfb4bc582aa10 (patch) | |
| tree | 3f424b6604d0072a32e5989d4204559e9579b080 /src/UniConversion.h | |
| parent | e3fb3e4d970c691eb696bdaeabb64e0e84d2d930 (diff) | |
| download | scintilla-mirror-c194249102cea0df80bcbe2d154dfb4bc582aa10.tar.gz | |
Fix non-BMP character entry through the inline IME.
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 8c7ac4a27..08898cac3 100644 --- a/src/UniConversion.h +++ b/src/UniConversion.h @@ -55,6 +55,12 @@ inline bool UTF8IsNEL(const unsigned char *us) { return (us[0] == 0xc2) && (us[1] == 0x85); } +enum { SURROGATE_LEAD_FIRST = 0xD800 }; +enum { SURROGATE_LEAD_LAST = 0xDBFF }; +inline unsigned int UTF16CharLength(wchar_t uch) { + return ((uch >= SURROGATE_LEAD_FIRST) && (uch <= SURROGATE_LEAD_LAST)) ? 2 : 1; +} + #ifdef SCI_NAMESPACE } #endif |
