This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Backport BOM_UTF8 REPLACEMENT_CHARACTER_UTF8
authorKarl Williamson <khw@cpan.org>
Thu, 4 Jul 2019 18:19:10 +0000 (12:19 -0600)
committerNicolas R <atoomic@cpan.org>
Fri, 27 Sep 2019 22:39:27 +0000 (16:39 -0600)
(cherry picked from commit 95c5c8d34cb28d3774aac13153a03ae61673bd82)
Signed-off-by: Nicolas R <atoomic@cpan.org>
dist/Devel-PPPort/parts/inc/utf8

index 2664905..b2cd019 100644 (file)
@@ -42,6 +42,19 @@ __UNDEFINED__ isUTF8_CHAR(s0, e)    (
     : UTF8SKIP(s0))
 #endif
 
+#if 'A' == 65
+__UNDEFINED__ BOM_UTF8                    "\xEF\xBB\xBF"
+__UNDEFINED__ REPLACEMENT_CHARACTER_UTF8  "\xEF\xBF\xBD"
+#elif '^' == 95
+__UNDEFINED__ BOM_UTF8                    "\xDD\x73\x66\x73"
+__UNDEFINED__ REPLACEMENT_CHARACTER_UTF8  "\xDD\x73\x73\x71"
+#elif '^' == 176
+__UNDEFINED__ BOM_UTF8                    "\xDD\x72\x65\x72"
+__UNDEFINED__ REPLACEMENT_CHARACTER_UTF8  "\xDD\x72\x72\x70"
+#else
+#  error Unknown character set
+#endif
+
 #if { VERSION < 5.31.3 }
         /* Versions prior to this accepted things that are now considered
          * malformations, and didn't return -1 on error with warnings enabled