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



Hi Peter,

Don't know if this is actually related to your problem, but from my
experience GTK or Gnome itself does not support UTF-8 but only single
byte charsets, so you need to convert to a single-byte encoding that
is able to be rendered by Gnome. This is what I do for example:

use Encode;

[...]

my $msg = "UTF-8 TEXT";

Encode::from_to($msg,'utf8','iso-8859-1');

  my $dialog = Gtk2::MessageDialog->new ($parent,
                                         'destroy-with-parent',
                                         'question',
                                         'yes-no',
                                         $msg);

On Sun, May 9, 2010 at 9:43 AM, Peter Daum <gator_ml yahoo de> wrote:
On 2010-05-09 10:59, Marius Feraru wrote:
Peter Daum <gator_ml yahoo de> wrote:
 print map( {sprintf("%X ", $_) } unpack("C*", $entry->get_text )), "\n"
http://perldoc.perl.org/perl5100delta.html#Packing-and-UTF-8-strings
;-)

... you're right - my sample code was only behaving differently because
of the changes in "pack". I thought I had found a simple test case, but
as it looks like now, I don't really know yet what change broke my
program (probably something in Net::LDAP and not in Gtk2-Perl after all).

Thanks to everybody,
                                      Peter



_______________________________________________
gtk-perl-list mailing list
gtk-perl-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list




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