Thread Tk::Error: Wide character in subroutine entry (8 answers)
Opened by Gast at 2007-08-02 15:12

Gast Gast
 2007-08-02 20:07
#97344 #97344
Ja, klar:

Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/local/bin/perl

use Tk;
use strict;
use warnings;

my $main = new Tk::MainWindow();

my $entry_test = $main->Entry()->pack();
my $btn_test = $main->Button( -text => ' Test ', 
                              -command => sub { 
                                               my $text = $entry_test->get(); 
                                               eval { utf8::downgrade($text); };
                                               &msg($main, $@) if ($@);                                                                                                 
                                              } )->pack();

sub msg
 {
  my ($parent, $msg) = @_;
  $parent->messageBox( -title => 'Event', -message => $msg, -type => 'ok', -icon => 'info' );
 }


MainLoop();


..und hier der Wide Character aus dem String, den ich zum Test genommen habe:
Code: (dl )

View full thread Tk::Error: Wide character in subroutine entry