summaryrefslogtreecommitdiff
path: root/lib/utf8_heavy.pl
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-04-21 22:24:52 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-04-21 22:24:52 +0000
commit11ef8fddd64f78304dc923b07dffddd7a4f28074 (patch)
tree9e4865a4b94fc5d2b8eedb15ab84bd31d2dba4b3 /lib/utf8_heavy.pl
parentc37c92b7db9f3abf052d2fdfcf7c6e144d547bbd (diff)
downloadperl-11ef8fddd64f78304dc923b07dffddd7a4f28074.tar.gz
Make writing user-defined character properties nicer.
p4raw-id: //depot/perl@16054
Diffstat (limited to 'lib/utf8_heavy.pl')
-rw-r--r--lib/utf8_heavy.pl8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/utf8_heavy.pl b/lib/utf8_heavy.pl
index 29d4ac2c7d..d5a0b335c2 100644
--- a/lib/utf8_heavy.pl
+++ b/lib/utf8_heavy.pl
@@ -184,7 +184,13 @@ sub SWASHNEW {
print STDERR "$1 => $2\n" if DEBUG;
if ($char =~ /[-+!]/) {
my ($c,$t) = split(/::/, $name, 2); # bogus use of ::, really
- my $subobj = $c->SWASHNEW($t, "", 0, 0, 0);
+ my $subobj;
+ if ($c eq 'utf8') {
+ $subobj = $c->SWASHNEW($t, "", 0, 0, 0);
+ }
+ elsif ($c =~ /^([0-9a-fA-F]+)/) {
+ $subobj = utf8->SWASHNEW("", $c, 0, 0, 0);
+ }
return $subobj unless ref $subobj;
push @extras, $name => $subobj;
$bits = $subobj->{BITS} if $bits < $subobj->{BITS};