This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: UTF-16 surrogate macros


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) == 0xD800)
> #define IS_LOW_SURROGATE(c) (((c) & 0xFC00) == 0xDC00)
> #define IS_SURROGATE_PAIR(hc,lc) (IS_HIGH_SURROGATE(hc) && IS_LOW_SURROGATE(lc))

Applied.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]