diff options
author | Karl Williamson <khw@cpan.org> | 2014-06-02 14:49:30 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2014-06-05 12:23:02 -0600 |
commit | d6ded95025185cb1ec8ca3ba5879cab881d8b180 (patch) | |
tree | 2d5d8e027167706f5a25f1456331ce3e189f1232 /dist/Data-Dumper | |
parent | e9efacb9548c04c657ed5e5320168a87934aec52 (diff) | |
download | perl-d6ded95025185cb1ec8ca3ba5879cab881d8b180.tar.gz |
Add parameters to "use locale"
This commit allows one to specify to enable locale-awareness for only a
specified subset of the locale categories. Thus you could make a
section of code LC_MESSAGES aware, with no locale-awareness for the
other categories.
Diffstat (limited to 'dist/Data-Dumper')
-rw-r--r-- | dist/Data-Dumper/Dumper.pm | 2 | ||||
-rw-r--r-- | dist/Data-Dumper/Dumper.xs | 23 |
2 files changed, 17 insertions, 8 deletions
diff --git a/dist/Data-Dumper/Dumper.pm b/dist/Data-Dumper/Dumper.pm index 6f7a0d8226..9afeac77b7 100644 --- a/dist/Data-Dumper/Dumper.pm +++ b/dist/Data-Dumper/Dumper.pm @@ -1398,7 +1398,7 @@ modify it under the same terms as Perl itself. =head1 VERSION -Version 2.152 (March 7 2014) +Version 2.153 (June 5 2014) =head1 SEE ALSO diff --git a/dist/Data-Dumper/Dumper.xs b/dist/Data-Dumper/Dumper.xs index e98c6d70d0..03515aec53 100644 --- a/dist/Data-Dumper/Dumper.xs +++ b/dist/Data-Dumper/Dumper.xs @@ -838,15 +838,24 @@ DD_dump(pTHX_ SV *val, const char *name, STRLEN namelen, SV *retval, HV *seenhv, av_push(keys, sv); } # ifdef USE_LOCALE_NUMERIC - sortsv(AvARRAY(keys), - av_len(keys)+1, - IN_LOCALE ? Perl_sv_cmp_locale : Perl_sv_cmp); -# else - sortsv(AvARRAY(keys), - av_len(keys)+1, - Perl_sv_cmp); +# ifdef IN_LC /* Use this if available */ + if (IN_LC(LC_COLLATE)) +# else + if (IN_LOCALE) +# endif + { + sortsv(AvARRAY(keys), + av_len(keys)+1, + Perl_sv_cmp_locale); + } + else # endif #endif + { + sortsv(AvARRAY(keys), + av_len(keys)+1, + Perl_sv_cmp); + } } if (sortkeys != &PL_sv_yes) { dSP; ENTER; SAVETMPS; PUSHMARK(sp); |