wxFilePicker and special chars

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
pbneves
Earned a small fee
Earned a small fee
Posts: 10
Joined: Fri Feb 15, 2019 11:37 am

wxFilePicker and special chars

Post by pbneves » Thu Jun 20, 2019 3:25 pm

Hi everyone,

Why wxFilePicker in Linux doesn't read the full path to a file if in that path are non-ascii chars like ç, ó, é, etc?
Where can I find documentation related to this issue, or how can I solve this problem?
Thanks,

DavidHart
Site Admin
Site Admin
Posts: 3866
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: wxFilePicker and special chars

Post by DavidHart » Thu Jun 20, 2019 5:01 pm

Hi,

It works for me, using either wx3.0.4 or wx3.1.3 on debian stretch. The FilePicker part of the 'widgets' sample correctly locates and 'picks' the filepath /mnt/everythingelse/vtemp/Testçóé/Testçóé.txt.

Which distro/version, which locale, which wx version is failing for you? Does its 'widgets' sample also fail? If so, please try again with wx3.0.4 if you're not already using that or wx3.1.

If it's still failing, can you attach a minimal compilable sample that demonstrates the failure?

Regards,

David

pbneves
Earned a small fee
Earned a small fee
Posts: 10
Joined: Fri Feb 15, 2019 11:37 am

Re: wxFilePicker and special chars

Post by pbneves » Fri Jun 21, 2019 8:08 am

Hi David,

Thanks for your reply.
I'm using Slackware64 with locale pt_PT using iso8859-1 encoding and wxWidgets version 3.0.4.
The widgets sample also fails when I'm using the text control to display the full path to the file.
I've managed to simulate two things. If put a file on a path that was built with a Konsole app in UTF8 mode the wxFilePicker and the text control works fine, but if I do a similar path with the Konsole in Iso8859-1 mode the wxFilePicker let me choose the file but the path in the text control becomes empty and it points to nowhere.
Regards,
Pedro

DavidHart
Site Admin
Site Admin
Posts: 3866
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: wxFilePicker and special chars

Post by DavidHart » Fri Jun 21, 2019 1:29 pm

If put a file on a path that was built with a Konsole app in UTF8 mode the wxFilePicker and the text control works fine, but if I do a similar path with the Konsole in Iso8859-1 mode the wxFilePicker let me choose the file but the path in the text control becomes empty and it points to nowhere.
That makes sense, and I can do something similar here:
I told a konsole instance to be Iso8859-1, then did

Code: Select all

/mnt/everythingelse/vtemp/keytest/anothertest> mkdir Testçó
/mnt/everythingelse/vtemp/keytest/anothertest> ls
Test??
/mnt/everythingelse/vtemp/keytest/anothertest> 
I then tested that dir with wxFilePicker. It had a similar issue:
FilePicker.png
FilePicker.png (8.98 KiB) Viewed 126 times

I don't think this is really a wx problem, just a consequence of abusing Iso8859-1 mode.

Post Reply