Skip to content

Commit

Permalink
Keep track of if collation locale is UTF-8 or not
Browse files Browse the repository at this point in the history
This will be used in future commits
  • Loading branch information
khwilliamson committed May 24, 2016
1 parent 00bf60c commit 165a1c5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions embedvar.h
Expand Up @@ -168,6 +168,7 @@
#define PL_in_clean_objs (vTHX->Iin_clean_objs)
#define PL_in_eval (vTHX->Iin_eval)
#define PL_in_load_module (vTHX->Iin_load_module)
#define PL_in_utf8_COLLATE_locale (vTHX->Iin_utf8_COLLATE_locale)
#define PL_in_utf8_CTYPE_locale (vTHX->Iin_utf8_CTYPE_locale)
#define PL_incgv (vTHX->Iincgv)
#define PL_initav (vTHX->Iinitav)
Expand Down
1 change: 1 addition & 0 deletions intrpvar.h
Expand Up @@ -245,6 +245,7 @@ PERLVAR(I, exit_flags, U8) /* was exit() unexpected, etc. */

PERLVAR(I, utf8locale, bool) /* utf8 locale detected */
PERLVAR(I, in_utf8_CTYPE_locale, bool)
PERLVAR(I, in_utf8_COLLATE_locale, bool)
#ifdef USE_LOCALE_CTYPE
PERLVAR(I, warn_locale, SV *)
#endif
Expand Down
3 changes: 3 additions & 0 deletions locale.c
Expand Up @@ -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;
}

Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions sv.c
Expand Up @@ -14789,6 +14789,7 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
/* Did the locale setup indicate UTF-8? */
PL_utf8locale = proto_perl->Iutf8locale;
PL_in_utf8_CTYPE_locale = proto_perl->Iin_utf8_CTYPE_locale;
PL_in_utf8_COLLATE_locale = proto_perl->Iin_utf8_COLLATE_locale;
/* Unicode features (see perlrun/-C) */
PL_unicode = proto_perl->Iunicode;

Expand Down

0 comments on commit 165a1c5

Please sign in to comment.