in reply to Tk unicode paths chooseDirectory vs getOpenFile and getSaveFile

I don't have a solution, nor can comment on your latest update, but can only confirm: for me, getOpenFile returns correct utf8 path in all tests.

chooseDirectory, for "ã" dir, returns plain Latin "a" as trailing path component, with utf8::is_utf8 being false. While, for "у" -- Cyrillic, qq(\x{443}) -- it returns utf8, but "ó". Weird and broken.

Replies are listed 'Best First'.
Re^2: Tk unicode paths chooseDirectory vs getOpenFile and getSaveFile
by vr (Curate) on Mar 05, 2019 at 14:48 UTC

    No solution with Tk yet, but I conducted a little investigation, Prima on Windows suffers the same (or worse) issues with Unicode in paths returned from standard file/directory selection dialogs. But IUP appears to perform correctly in my tests:

    use strict; use warnings; use feature 'say'; binmode STDOUT, 'utf8'; use IUP ':all'; my $dlg = IUP::FileDlg-> new( DIALOGTYPE => 'OPEN' ); # try 'DIR' for +folder selection my $app = IUP::Dialog-> new( TITLE => 'Test', MARGIN => '10x10', GAP = +> 10, child => IUP::Vbox-> new([ IUP::Button-> new( TITLE => 'Select', PADDING => '10x10', ACTI +ON => sub { $dlg-> Popup; if ( $dlg-> STATUS != -1 ) { say $dlg-> VALUE; } return IUP_DEFAULT }), ]), ); $app-> Show; IUP-> MainLoop;

    (Maybe consider this toolkit as replacement? :) Looks nice, and feature-rich and cross-platform, too.)

      Thank you for pointing me to IUP which I never heard of before. why it is never ever mentioned in connection to Perl and GUI?!? It looks very interesting! Unfortunately, in my case the (very big) application is based on Tk, and changing toolkit is not possible.