X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Sun, 9 Aug 2009 14:26:03 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: UTF-16 surrogate macros Message-ID: <20090809122603.GA24415@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <416096c60908090442j6b238c0fte0d6d20960524a6b AT mail DOT gmail DOT com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <416096c60908090442j6b238c0fte0d6d20960524a6b@mail.gmail.com> User-Agent: Mutt/1.5.19 (2009-02-20) Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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