From 5814e29cdbe370a417d654dbd18620849aa00a09 Mon Sep 17 00:00:00 2001 From: ZyX Date: Wed, 3 Feb 2016 21:46:01 +0300 Subject: eval/decode: Fix surrogate pairs processing --- src/nvim/eval/encode.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/nvim/eval/encode.h') 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 -- cgit