X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=utf8.h;h=c475d0f2873285f91b4d3259dfbc5e3540adc670;hb=0af80b6034aad516a126a9414dadccac4de7f9dc;hp=baee5ae2c456df1a6fa2020226e367d64ef941ed;hpb=0064a8a9866779dceb087452b9bfaa733c51adce;p=p5sagit%2Fp5-mst-13.2.git diff --git a/utf8.h b/utf8.h index baee5ae..c475d0f 100644 --- a/utf8.h +++ b/utf8.h @@ -7,6 +7,15 @@ * */ +/* Use UTF-8 as the default script encoding? + * Turning this on will break scripts having non-UTF8 binary + * data (such as Latin-1) in string literals. */ +#ifdef USE_UTF8_SCRIPTS +# define USE_UTF8_IN_NAMES (!IN_BYTES) +#else +# define USE_UTF8_IN_NAMES (PL_hints & HINT_UTF8) +#endif + #ifdef EBCDIC /* The equivalent of these macros but implementing UTF-EBCDIC are in the following header file: @@ -128,7 +137,6 @@ END_EXTERN_C #define UTF8_MAXLEN 13 /* how wide can a single UTF8 encoded character become */ -/* #define IN_UTF8 (PL_curcop->op_private & HINT_UTF8) */ #define IN_BYTES (PL_curcop->op_private & HINT_BYTES) #define DO_UTF8(sv) (SvUTF8(sv) && !IN_BYTES) @@ -159,6 +167,8 @@ END_EXTERN_C #define UNICODE_IS_BYTE_ORDER_MARK(c) ((c) == UNICODE_BYTER_ORDER_MARK) #define UNICODE_IS_ILLEGAL(c) ((c) == UNICODE_ILLEGAL) -#define UTF8_QUAD_MAX UINT64_C(0x1000000000) +#ifdef HAS_QUAD +# define UTF8_QUAD_MAX UINT64_C(0x1000000000) +#endif #define UTF8_IS_ASCII(c) UTF8_IS_INVARIANT(c)