Re: Question and possibly bugs about string encoding in gtk-perl



On Friday, 16 December 2016 21:34:55 CET Torsten Schönfeld wrote:
So it seems like the safest bet would be to try to decode the window 
name from UTF8, and if that fails, try Encode::X11 and its 
'x11-compound-text' (Hi Kevin!).

ok, that makes sense. 

For the record, here's what I'm going to use:

my $raw_name = $win->get_name;
my $name;
eval { $name = decode( 'UTF-8' , $raw_name, 1); };
$name = decode( 'x11-compound-text', $raw_name ) if $@;

Many thanks for the help :-)

All the best
-- 
 https://github.com/dod38fr/   -o- http://search.cpan.org/~ddumont/
http://ddumont.wordpress.com/  -o-   irc: dod at irc.debian.org


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