aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval/encode.h
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2016-02-03 21:46:01 +0300
committerZyX <kp-pav@yandex.ru>2016-04-18 02:45:49 +0300
commit5814e29cdbe370a417d654dbd18620849aa00a09 (patch)
treecb9c245c0fef3990abf0dbfc4ce986fa1303b05a /src/nvim/eval/encode.h
parentea82270d30eef2dd716cd158d989f96fbd503ba6 (diff)
downloadrneovim-5814e29cdbe370a417d654dbd18620849aa00a09.tar.gz
rneovim-5814e29cdbe370a417d654dbd18620849aa00a09.tar.bz2
rneovim-5814e29cdbe370a417d654dbd18620849aa00a09.zip
eval/decode: Fix surrogate pairs processing
Diffstat (limited to 'src/nvim/eval/encode.h')
-rw-r--r--src/nvim/eval/encode.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/nvim/eval/encode.h b/src/nvim/eval/encode.h
index 0e60c96155..9bc665253b 100644
--- a/src/nvim/eval/encode.h
+++ b/src/nvim/eval/encode.h
@@ -54,6 +54,21 @@ static inline ListReaderState encode_init_lrstate(const list_T *const list)
/// Array mapping values from SpecialVarValue enum to names
extern const char *const encode_special_var_names[];
+/// First codepoint in high surrogates block
+#define SURROGATE_HI_START 0xD800
+
+/// Last codepoint in high surrogates block
+#define SURROGATE_HI_END 0xDBFF
+
+/// First codepoint in low surrogates block
+#define SURROGATE_LO_START 0xDC00
+
+/// Last codepoint in low surrogates block
+#define SURROGATE_LO_END 0xDFFF
+
+/// First character that needs to be encoded as surrogate pair
+#define SURROGATE_FIRST_CHAR 0x10000
+
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "eval/encode.h.generated.h"
#endif