Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Tk FBox utf8 problem solved!

by Khariton (Sexton)
on Nov 24, 2010 at 19:16 UTC ( #873529=note: print w/replies, xml ) Need Help??

in reply to Re^3: Wx with Tk
in thread Wx with Tk

We are must going in another way...
I solve my problem in another way. May be this will be usefull for another men who using Tk and need using utf-8 filenames.
I must using Tk and Wx in one code.But from Wx I use only Filedialog. Why I must use Wx FileDialog?
Because Tk has embeded problem with UTF-8 filenames. It shows in IconList dialog broken filenames if codepage of filenames different than iso8859-1...
If I use in my code
use encoding 'utf8';
then IconList shows true but I can't choose folders with utf8 names and choosed filename in filedialog shows as ?????.???
In end of page I find this:
Unfortunately, there are still places in Perl ignorant of Unicode. One of these places are filenames. Consequently, the file selectors in Perl/Tk do not handle encoding of filenames properly. Currently they suppose that filenames are in iso-8859-1 encoding, at least on Unix systems. As soon as Perl has a concept of filename encodings, then Perl/Tk will also implement such schemes.
Early I can't resolve this problem but after You hint for MyMenuButton module( I get method how I can resolve my problem.
I found this:
1. If I remove all about encoding in FBox(it has only 8859-1 codepage support).
2. If I add in FBox module
use encoding 'utf8';
then all works fine.
By Your method I insert new MyFBox module in my code. And some corrects in fdialog design for my wishes. I can adding some png pictures instead standart bitmaps...
Thank You for help!

Replies are listed 'Best First'.
Re: Tk FBox utf8 problem solved!
by zentara (Archbishop) on Nov 25, 2010 at 12:02 UTC
    Hey, thanks for reporting this solution. To be honest, if I was starting a big project, I would use Gtk2... the code is much more up-to-date.

    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku ................... flash japh
      I find new problem: FDialog has problem(working with folders) in Win32.
      I will write correct code to getting work version of this procedure...
      About GTK2: I read this module has problem for working on Win32 platform?
        About GTK2: I read this module has problem for working on Win32 platform?

        No problems if it is built correctly. See Camelbox: A build of Gtk2-Perl for Windows for an easy to install Gtk2 enabled Perl on Win32.... the only drawback is it dosn't come with a pre-built Tk module.... so you get Gtk2 but give up Tk, unless you can figure out the complicated compiler situation on Win32, so you can build Tk from the CamelBox Perl version. But CamelBox does come with all the Network and DBI modules.

        I'm not really a human, but I play one on earth.
        Old Perl Programmer Haiku ................... flash japh

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://873529]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (3)
As of 2018-03-18 08:59 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (229 votes). Check out past polls.