This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
mktables: Use modern \X definition for early Unicodes
authorKarl Williamson <public@khwilliamson.com>
Wed, 16 May 2012 16:38:49 +0000 (10:38 -0600)
committerKarl Williamson <public@khwilliamson.com>
Sat, 2 Jun 2012 14:29:24 +0000 (08:29 -0600)
commit30769324d5b5817b636adf96c550dd548eda201a
tree40eb7c551c731df40658d03716c56787b54a0cda
parentc6005d23508ec68d2332c45486cba6937f51fca2
mktables: Use modern \X definition for early Unicodes

\X matches an extended grapheme cluster, and requires the Grapheme
Cluster Break Property, and the Hangul Syllable Type property for
complete proper functioning.  This concept was not introduced until
Unicode 5.1.  Prior to that was the basic "grapheme cluster", which was
introduced in Unicode series 3.  The extended version is only a slight
modification of the basic one, and so the basic one can be used for
adequate processing of most scripts.  That is, if we use the basic
definition in Unicode version that lack the extra information for the
extended version, things are degraded cleanly.  It would be possible to
add intelligence to mktables to generate the extended version for all
releases, but since the difference between the two isn't great, the
payoff isn't worth it.

Until commit 5edb45fb0350d27b109ca489724513b86f9cb7bc for Perl v5.12,
Perl used a simpler definition for \X: a non-mark character followed by
any number of marks.  Until the current commit, that definition was
clung to when run on early Unicodes that didn't furnish the definitions
of the properties needed to generate the grapheme cluster definition.

However, it turns out that it is fairly easy to generate those property
definitions, and this commit does that.  And, once those are done, the
special cases for early versions can be removed (except for the
distinction between extended and non- grapheme clusters).

This commit generates the needed tables into Perl internal properties.
A future commit will change the code that processes \X to use these; in
the meantime it uses the existing properties that are generated anyway
for Unicodes where they don't have to be calculated, and which are
identical to the new internal ones.  (Code elsewhere in mktables assures
that identical properties share the same file.)  By using internal
properties, application code only gains access to the official
properties in the releases they are officially defined.  For example, it
won't work for an application to use the Hangul Syllable Type property
unless it is in a release where Unicode has defined it.  To allow access
in earlier releases would be misrepresenting what the Standard says.
lib/unicore/mktables