develooper Front page | perl.perl5.porters | Postings from September 2000

SWATCH and uc() etc. with UNICODE.

From:
Nick Ing-Simmons
Date:
September 30, 2000 13:25
Subject:
SWATCH and uc() etc. with UNICODE.
Message ID:
E13fTCJ-0002al-00@serv1.is1.u-net.net

Continuing to try and get Tk's UNICODE support finished I now find 
that when I have (for example) 

my $string = join('',map(chr($_),0xe0..0xff));
my $lc     = lc($string);

Then Perl_is_uni_upper() calls SWASHNEW which tries to call Tk->IsUpper
which does not exist. This seems to be due to this code in utf8_heavy.pl:

sub SWASHNEW {
    my ($class, $type, $list, $minbits, $none) = @_;
    local $^D = 0 if $^D;
    print STDERR "SWASHNEW @_\n" if $DEBUG;
    my $extras;
    my $bits;
 
    if ($type and ref ${"${class}::{$type}"} eq $class) {
	warn qq/Found \${"${class}::{$type}"}\n/ if $DEBUG;
	return ${"${class}::{$type}"};	# Already there...
    }

    $type ||= $seq++;

    my $caller;
    my $i = 0;
    while (($caller = caller($i)) eq __PACKAGE__) { $i++ }
    my $encoding = $enc{$caller} || "unicode";
    (my $file = $type) =~ s!::!/!g;
    $file =~ s#^(I[sn]|To)([A-Z].*)#$1/$2#;
    $list ||= eval { $caller->$type(); }
    	|| do "$file.pl"
	|| do "$encoding/$file.pl"
	|| do "$encoding/Is/${type}.pl"
	|| croak("Can't find $encoding character property definition via $caller->$type or $file.pl");

Does anyone know why it does that ?

It seems as soon as any 'use utf8' is seen then the above mess fires
and Tk's attempt to "toupper()" the program name to use a a window 
title is doomed to fail :-(





-- 
Nick Ing-Simmons




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About