Re: UTF-16 surrogate macros

2009-08-09 Thread Corinna Vinschen
On Aug 9 12:42, Andy Koppe wrote: > w32api/winnls.h is lacking the macros for recognising UTF-16 > surrogates: IS_HIGH_SURROGATE, IS_LOW_SURROGATE, IS_SURROGATE_PAIR. > Here's one way to define them, which avoids evaluating the characters > twice: > > #define IS_HIGH_SURROGATE(c) (((c) & 0xFC00)

UTF-16 surrogate macros

2009-08-09 Thread Andy Koppe
w32api/winnls.h is lacking the macros for recognising UTF-16 surrogates: IS_HIGH_SURROGATE, IS_LOW_SURROGATE, IS_SURROGATE_PAIR. Here's one way to define them, which avoids evaluating the characters twice: #define IS_HIGH_SURROGATE(c) (((c) & 0xFC00) == 0xD800) #define IS_LOW_SURROGATE(c) (((c) &