This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Implement the fc keyword and the \F string escape.
authorBrian Fraser <fraserbn@gmail.com>
Thu, 12 Jan 2012 20:22:05 +0000 (17:22 -0300)
committerKarl Williamson <public@khwilliamson.com>
Sun, 29 Jan 2012 17:07:40 +0000 (10:07 -0700)
commit838f2281125c4e0f98e5d741f9058f09c8242d33
tree6fa3458446be72105180d95d66cf87a1d3b7cf3b
parent2a4315f8fb099a3fd3bbd5d9994af3919a6c5b05
Implement the fc keyword and the \F string escape.

Along with the simple_casefolding and full_casefolding features.

fc() stands for foldcase, a sort of pseudo case (like lowercase),
which is used to implement Unicode casefolding. It maps a string
to a form where all case differences are erased, so it's a
locale-independent way of checking if two strings are the same,
regardless of case.

This functionality was, and still is, available through the
regular expression engine -- /i matches would use casefolding
internally. The fc keyword merely exposes this for easier access.

Previously, one could attempt to case-insensitively test two strings
for equality by doing

   lc($a) eq lc($b)

But that might get you wrong results, for example in the case of
\x{DF}, LATIN SMALL LETTER SHARP S.
18 files changed:
dist/B-Deparse/Deparse.pm
dist/B-Deparse/t/core.t
dist/B-Deparse/t/deparse.t
ext/Opcode/Opcode.pm
keywords.c
keywords.h
opcode.h
opnames.h
pp.c
pp_proto.h
regen/keywords.pl
regen/opcodes
t/op/coreamp.t
t/op/cproto.t
t/op/lc.t
t/op/taint.t
t/uni/fold.t
toke.c