in reply to Re: Tk Photo method
in thread Tk Photo method

This filename eq name with 12 cyrylic chars with charcodes which was shown by perlmonks site. This Perlmonks site not show international utf-8 chars. It show only latin chars.
This filename was like $filename='/home/user/ABCDEFRGHTHT.jpg'
where big chars was a cyrylic chars. I needn't enter filenames as \x{1234}. I show this only as example.
I get filenames by filedialog and save it in variable $filename for example.
I use in code directive
use utf8;
and I can open files by open(F,'<:raw',...) function with encoding or decoding by Encode module...
This all works with standart functions but not work with Tk. I write about this in (http://www.perlmonks.org/?node_id=873529). Tk functions good work only with codepage iso8859-1.
I am correcting FDialog for utf8(but this work fine only on unix. Now I have problem with chdir and cwd functions in win32).
But now I see problem with Photo method. And this is problem for me. I can't correcting method Photo for himself too...
Can I load .jpg file to pointer in memory and use it in any way in Tk? Or may be present another methods...
I see in Image::Magick I can load picture by Read function, but I can load it by standard open function and use pointer to this picture in Image::Magick. May be in Tk I can use some any method for loading picture too?

Replies are listed 'Best First'.
Re^3: Tk Photo method
by Khariton (Sexton) on Nov 26, 2010 at 18:41 UTC
    Previous message was mine...
    For correct this problem I create this sub:
    sub myPhoto { my $f=shift; copy($f,fn($tmpdir.'myphototmp')); $TOP->Photo(-file=>$tmpdir.'myphototmp'); }
    and use it in code as:
    createImage(x,y,-image=>myPhoto($filename));

    This is some slowly but it work!

    P.S.: I mean Perl/Tk and UTF-8 international support get for me many new surprises.