#!/usr/bin/perl package MyWin use utf8; use Encode; [...] sub open_response_cb { # $file is the file that we get from the FileChooserDialog $file = $open_dialog->get_file(); # an empty string (provisionally) #my $content = ''; # load the content of the file into memory: # success is a boolean depending on the success of the operation # content is self-explanatory # etags is an entity tag (can be used to quickly determine if the # file has been modified from the version on the file system) my ($success, $content, $etags) = Glib::IO::File::load_contents($file) or print "Error:"; #my $content_raw = Dumper $content; #print "DUMPER: $content_raw \n"; # Ich hab auch pack('C*' ...) probiert $content = pack( 'U*', @{$content} ); my $length = length(Encode::encode_utf8($content)); $buffer->set_text($content,$length);