diff options
author | Sam Hocevar <sam@hocevar.net> | 2015-11-20 10:43:26 +1100 |
---|---|---|
committer | Sam Hocevar <sam@hocevar.net> | 2015-11-20 10:43:26 +1100 |
commit | 1f9bc0d42bc53fd04cc848da1da52635dcf7a2c0 (patch) | |
tree | c3a81badf03c26ae81cffe258df9dec094966fa7 /src/UniConversion.h | |
parent | 5bd63ddfe65136ace6d11ec363b4f33e10fdbb49 (diff) | |
download | scintilla-mirror-1f9bc0d42bc53fd04cc848da1da52635dcf7a2c0.tar.gz |
Bug [#1779]. Better Unicode input support on Windows systems.
- support surrogate pairs in WM_CHAR messages
- support characters from supplementary planes in WM_UNICHAR messages
- support WM_UNICHAR messages in non-Unicode mode
- fix some code duplication
Also, do not return FALSE upon receiving a WM_UNICHAR message with
a UNICODE_NOCHAR parameter, since WM_UNICHAR can actually be handled
just fine (at least with the exact same level of support as WM_CHAR).
Diffstat (limited to 'src/UniConversion.h')
-rw-r--r-- | src/UniConversion.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/UniConversion.h b/src/UniConversion.h index 08898cac3..aeb13f0c2 100644 --- a/src/UniConversion.h +++ b/src/UniConversion.h @@ -57,6 +57,10 @@ inline bool UTF8IsNEL(const unsigned char *us) { enum { SURROGATE_LEAD_FIRST = 0xD800 }; enum { SURROGATE_LEAD_LAST = 0xDBFF }; +enum { SURROGATE_TRAIL_FIRST = 0xDC00 }; +enum { SURROGATE_TRAIL_LAST = 0xDFFF }; +enum { SUPPLEMENTAL_PLANE_FIRST = 0x10000 }; + inline unsigned int UTF16CharLength(wchar_t uch) { return ((uch >= SURROGATE_LEAD_FIRST) && (uch <= SURROGATE_LEAD_LAST)) ? 2 : 1; } |