Tiny Core Extensions > TCE Bugs

GTK2 and GTK3 cannot handle Unicode characters in file names

(1/6) > >>

GNUser:
I'm on Pure64 10.1. In all GTK2 and GTK3 applications, I get an error ("Invalid file name") in file selection box whenever I include a Unicode character in the filename. Here's an example when trying to save a file while using a GTK3 application:



I'm using a Unicode locale:

--- Code: ---bruno@box:~$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

--- End code ---
BTW I do not have this problem with applications that use a different graphical toolkit: Xfe file manager uses fox toolkit and can create new files and directories with Unicode characters in their names without any problem.

What do I need to do in order for GTK2 and GTK3 applications in Pure64 to support Unicode characters in file names?

P.S. The same GTK2 and GTK3 applications running in different OS (e.g., Devuan) can handle Unicode characters in filenames. So my guess is that this is either a base system issue in Pure64 or else an issue with how GTK2 and GTK3 were compiled for Pure64.

curaga:
That "invalid file name" dialog in gtk2 comes from gtkfilechooserdefault.c. That then calls it because g_file_get_child_for_display_name from glib2 failed. Maybe this helps in pinpointing.

Juanito:
Since the error occurs when accessing the file system, does your mount command need a utf8 switch?

GNUser:
juanito - No, mount command in urxvt just works (even if there are Unicode characters in the mountpoint). No need for utf8 switch:


--- Code: ---bruno@box:~$ which mount
/bin/mount
bruno@box:~$ ls -l /bin/mount
lrwxrwxrwx    1 root     root            12 Jun  9  2019 /bin/mount -> busybox.suid

bruno@box:~$ sudo mkdir /mnt/eĥoŝanĝoĉiuĵaŭde
bruno@box:~$ sudo mount /dev/sdc1 /mnt/eĥoŝanĝoĉiuĵaŭde
bruno@box:~$ ls /mnt/eĥoŝanĝoĉiuĵaŭde
somefile.txt   test1.txt      test2.txt      some_dir/

--- End code ---

GNUser:
At lowest level, the C library in Pure64 can handle UTF-8 in filenames beautifully:


--- Code: ---bruno@box:~$ cat test.c
#include <stdio.h>

int main(void)
{
FILE *fp;

fp = fopen("/home/bruno/eĥoŝanĝoĉiuĵaŭde.txt", "w+");
fprintf(fp, "hello world");
fclose(fp);
return 1;
}
bruno@box:~$ tce-load -wi compiletc
bruno@box:~$ gcc test.c
bruno@box:~$ ./a.out
bruno@box:~$ cat eĥoŝanĝoĉiuĵaŭde.txt
hello world

--- End code ---

Also, it seems that GTK is UTF-8 aware out of the box, so the GTK2 and GTK3 libraries themselves are probably innocent. There's some helpful information here: https://wiki.gentoo.org/wiki/UTF-8

Since both GTK2 and GTK3 are affected, my guess is that the problem lies with one of their shared dependencies responsible for parsing filenames.

Alas, I know very little about the GUI stack. I will not be able to investigate this further without guidance from someone more knowledgeable.

Navigation

[0] Message Index

[#] Next page

Go to full version