aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorSam Hocevar <sam@hocevar.net>2015-11-20 10:43:26 +1100
committerSam Hocevar <sam@hocevar.net>2015-11-20 10:43:26 +1100
commit393a48b469af457392d4120b2d4351c345c4486c (patch)
treeeb6127e2c2af807e5a16b3cf96af993ce9c60d7e /src
parent4064c90ef55ec3c027245a95fe0cd911a5de1354 (diff)
downloadscintilla-mirror-393a48b469af457392d4120b2d4351c345c4486c.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')
-rw-r--r--src/UniConversion.cxx4
-rw-r--r--src/UniConversion.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/UniConversion.cxx b/src/UniConversion.cxx
index c12ca34c2..4da9e102a 100644
--- a/src/UniConversion.cxx
+++ b/src/UniConversion.cxx
@@ -19,10 +19,6 @@ using namespace Scintilla;
namespace Scintilla {
#endif
-enum { SURROGATE_TRAIL_FIRST = 0xDC00 };
-enum { SURROGATE_TRAIL_LAST = 0xDFFF };
-enum { SUPPLEMENTAL_PLANE_FIRST = 0x10000 };
-
unsigned int UTF8Length(const wchar_t *uptr, unsigned int tlen) {
unsigned int len = 0;
for (unsigned int i = 0; i < tlen && uptr[i];) {
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;
}