Change 11656 by jhi@alpha on 2001/08/12 23:24:18
Add -DUSE_UTF8_SCRIPTS to your cflags and the Perl
will be built to do that by default (adding that
will break scripts having non-UTF-8 binary data,
such as Latin-1, in them.)
Affected files ...
... //depot/perl/op.c#428 edit
... //depot/perl/toke.c#378 edit
... //depot/perl/utf8.h#43 edit
Differences ...
==== //depot/perl/op.c#428 (text) ====
Index: perl/op.c
--- perl/op.c.~1~ Sun Aug 12 17:30:05 2001
+++ perl/op.c Sun Aug 12 17:30:05 2001
@@ -115,7 +115,7 @@
if (!(PL_in_my == KEY_our ||
isALPHA(name[1]) ||
- (PL_hints & HINT_UTF8 && UTF8_IS_START(name[1])) ||
+ (USE_UTF8_IN_NAMES && UTF8_IS_START(name[1])) ||
(name[1] == '_' && (int)strlen(name) > 2)))
{
if (!isPRINT(name[1]) || strchr("\t\n\r\f", name[1])) {
==== //depot/perl/toke.c#378 (text) ====
Index: perl/toke.c
--- perl/toke.c.~1~ Sun Aug 12 17:30:05 2001
+++ perl/toke.c Sun Aug 12 17:30:05 2001
@@ -36,11 +36,14 @@
#define XFAKEBRACK 128
#define XENUMMASK 127
-#ifdef EBCDIC
-/* For now 'use utf8' does not affect tokenizer on EBCDIC */
-#define UTF (PL_linestr && DO_UTF8(PL_linestr))
+#ifdef USE_UTF8_SCRIPTS
+# define UTF (!IN_BYTES)
#else
-#define UTF ((PL_linestr && DO_UTF8(PL_linestr)) || (PL_hints & HINT_UTF8))
+# ifdef EBCDIC /* For now 'use utf8' does not affect tokenizer on EBCDIC */
+# define UTF (PL_linestr && DO_UTF8(PL_linestr))
+# else
+# define UTF ((PL_linestr && DO_UTF8(PL_linestr)) || (PL_hints & HINT_UTF8))
+# endif
#endif
/* In variables named $^X, these are the legal values for X.
==== //depot/perl/utf8.h#43 (text) ====
Index: perl/utf8.h
--- perl/utf8.h.~1~ Sun Aug 12 17:30:05 2001
+++ perl/utf8.h Sun Aug 12 17:30:05 2001
@@ -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:
End of Patch.