This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Keep track of if collation locale is UTF-8 or not
[perl5.git] / locale.c
index 918c1d9..01fca15 100644 (file)
--- a/locale.c
+++ b/locale.c
@@ -485,6 +485,7 @@ Perl_new_collate(pTHX_ const char *newcoll)
       is_standard_collation:
        PL_collxfrm_base = 0;
        PL_collxfrm_mult = 2;
+        PL_in_utf8_COLLATE_locale = FALSE;
        return;
     }
 
@@ -498,6 +499,8 @@ Perl_new_collate(pTHX_ const char *newcoll)
             goto is_standard_collation;
         }
 
+        PL_in_utf8_COLLATE_locale = _is_cur_LC_category_utf8(LC_COLLATE);
+
        {
             /* A locale collation definition includes primary, secondary,
              * tertiary, etc. weights for each character.  To sort, the primary