Re: String Encocoding in Gtk-Perl: Hoping for Clarification

On 2010-05-09 08:42, Brian Manning wrote:
Gtk2-Perl is still returning UTF-8 data.

your example does indeed produce the same result on old and new systems,
obviously because "ord" and "split" work on characters, not bytes ...

Do you have a complete example that shows your problem?

#!/usr/bin/perl -w

use Gtk2 -init;

my $window = new Gtk2::Window( "toplevel" );
my $vbox   = new Gtk2::VBox(1,5);
my $button = new Gtk2::Button( "print" );
my $entry  = new Gtk2::Entry;

$window->signal_connect( "delete_event", sub { Gtk2->main_quit } );

$button->signal_connect( "clicked", sub {
print map( {sprintf("%X ", $_) } unpack("C*", $entry->get_text )), "\n"

$window->add( $vbox );
$vbox->add( $button );

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]