This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
amigaos4: ext/POSIX: no mkfifo
[perl5.git] / utf8.c
diff --git a/utf8.c b/utf8.c
index 2a44d75..1cb3f6d 100644 (file)
--- a/utf8.c
+++ b/utf8.c
@@ -115,7 +115,8 @@ Perl_uvoffuni_to_utf8_flags(pTHX_ U8 *d, UV uv, UV flags)
 #endif
 
     /* The first problematic code point is the first surrogate */
-    if (uv >= UNICODE_SURROGATE_FIRST
+    if (   flags    /* It's common to turn off all these */
+        && uv >= UNICODE_SURROGATE_FIRST
         && ckWARN3_d(WARN_SURROGATE, WARN_NON_UNICODE, WARN_NONCHAR))
     {
        if (UNICODE_IS_SURROGATE(uv)) {