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

SWATCH and uc() etc. with UNICODE.

Nick Ing-Simmons
September 30, 2000 13:25
SWATCH and uc() etc. with UNICODE.
Message ID:

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

    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 "$"
	|| do "$encoding/$"
	|| do "$encoding/Is/${type}.pl"
	|| croak("Can't find $encoding character property definition via $caller->$type or $");

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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About