X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/699a97de988b5b9b54375d79201e72f1c259685c..ef9da979fc5cddb4c5d039bc1c6205e98c09cc85:/utf8.h diff --git a/utf8.h b/utf8.h index 5ffee5b..659319e 100644 --- a/utf8.h +++ b/utf8.h @@ -1,6 +1,6 @@ /* utf8.h * - * Copyright (C) 2000, 2001, 2002, 2005, 2006 by Larry Wall and others + * Copyright (C) 2000, 2001, 2002, 2005, 2006, 2007, 2009 by Larry Wall and others * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -51,6 +51,7 @@ END_EXTERN_C /* Native character to iso-8859-1 */ #define NATIVE_TO_ASCII(ch) (ch) +#define NATIVE8_TO_UNI(ch) (ch) #define ASCII_TO_NATIVE(ch) (ch) /* Transform after encoding */ #define NATIVE_TO_UTF(ch) (ch) @@ -117,8 +118,8 @@ encoded character. #define UTF8_IS_CONTINUED(c) (((U8)c) & 0x80) #define UTF8_IS_DOWNGRADEABLE_START(c) (((U8)c & 0xfc) == 0xc0) -#define UTF_START_MARK(len) ((len > 7) ? 0xFF : (0xFE << (7-len))) -#define UTF_START_MASK(len) ((len >= 7) ? 0x00 : (0x1F >> (len-2))) +#define UTF_START_MARK(len) (((len) > 7) ? 0xFF : (0xFE << (7-(len)))) +#define UTF_START_MASK(len) (((len) >= 7) ? 0x00 : (0x1F >> ((len)-2))) #define UTF_CONTINUATION_MARK 0x80 #define UTF_ACCUMULATION_SHIFT 6 @@ -213,7 +214,7 @@ encoded character. #define UNICODE_ILLEGAL 0xFFFF /* Though our UTF-8 encoding can go beyond this, - * let's be conservative and do as Unicode 3.2 says. */ + * let's be conservative and do as Unicode 5.1 says. */ #define PERL_UNICODE_MAX 0x10FFFF #define UNICODE_ALLOW_SURROGATE 0x0001 /* Allow UTF-16 surrogates (EVIL) */ @@ -340,3 +341,13 @@ encoded character. #define IS_UTF8_CHAR_FAST(n) ((n) <= 4) #endif /* IS_UTF8_CHAR() for UTF-8 */ + +/* + * Local variables: + * c-indentation-style: bsd + * c-basic-offset: 4 + * indent-tabs-mode: t + * End: + * + * ex: set ts=8 sts=4 sw=4 noet: + */