Support for Unicode characters in GTK2/3 file selection box?

I’m on Tiny Core Linux Pure64 10.1. My locale is en_US.UTF-8 and I generally have no trouble with Unicode characters with one exception: When I try to use Unicode characters in GTK applications’ file selection box, I get “Invalid file name”:

The error affects both GTK2 and GTK3 applications.

Here is some info from terminal to show my locale and the fact that, at a low level, C library can handle Unicode characters in filenames:

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=

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:~$ gcc test.c
bruno@box:~$ ./a.out 
bruno@box:~$ cat eĥoŝanĝoĉiuĵaŭde.txt 
hello world

I’ve already asked for help at the Tiny Core Linux forum, but no luck so far.

GTK2 and GTK3 applications can display Unicode characters just fine. I can also type the characters into the applications. As far as I can tell, the issue seems limited to the file selection box.

Please, how do I enable Unicode support in the file selection boxes? Perhaps I need to re-compile whatever backend GTK’s file selection box uses, with attention to Unicode configuration options?

One more thought: I’m using Tiny Core Linux with fluxbox, so the system is extremely lean and I don’t have the whole GNOME stack installed–just what my GTK2 and GTK3 applications explicitly specify as dependencies.

What does GTK’s file selection dialog use to parse multibyte UTF-8 characters in filenames? Maybe the problem is that my system is missing it (whatever it is) and the solution is simply to install it.

Hi! GLib unicode functions are based on the unicode character data tables, which can take quite some disk space.

The implementations of the Unicode functions in GLib are based on the Unicode Character Data tables, which are available fromwww.unicode.org. GLib – 2.0

Here I can only guess, but probably tiny core linux strips them out?

From the package list I see there is glib2-locale.tcz, try installing it.

Thank you, lb90. A lot of things get stripped in TCL in the interest of keeping things tiny. I think you may have pinpointed the issue.

glib2-locale.tcz is available in the x86 repository, but not in the x86_64 repository. I’m using the 64-bit version of TCL. I’ll ask the developers about adding glib2-locale.tcz to the x86_64 repository.

If they add it, I’ll try installing it then will report back here.

One of the TCL gurus told me the x86 extension should work for x86_64, so I tried it. It made no difference in regard to this issue.

In case it’s relevant to glib2 unicode tables, let me reiterate a tidbit from my original post: I’m booting with en_US.UTF-8 locale selected and am loading the locale using the TCL-recommended way (via an extension called mylocale.tcz which contains en_US.UTF-8 locale files).

Ok! Right now I cannot see the image attached in the first post (I get an anauthorized access). Do you get the error by activating the file from the list, or by typing the file name in the edit control and then clicking open/save?

I don’t know if you have the gio utility in your system. If you have it open the terminal and type the command: gio info /path/to/your/file

lb90 - Sorry about that. Image in first post is fixed now.

Two TCL developers informed me that glib2-locale contains only .mo files (translated messages so that user can get glib2 errors in German, for example), not unicode tables or anything that would help with my issue.

Some new information: If I launch a GTK3 app from a terminal, this is what I see in the terminal when I trigger the problem:

Gtk-Message: 10:26:29.989: GtkDialog mapped without a transient parent. This is discouraged.

(iridium-browser:15381): dconf-WARNING **: 10:26:30.117: failed to commit changes to dconf: Unknown or unsupported transport “disabled” for address “disabled:”

(iridium-browser:15381): dconf-WARNING **: 10:26:30.160: failed to commit changes to dconf: Unknown or unsupported transport “disabled” for address “disabled:”

(iridium-browser:15381): dconf-WARNING **: 10:26:30.179: failed to commit changes to dconf: Unknown or unsupported transport “disabled” for address “disabled:”

(iridium-browser:15381): dconf-WARNING **: 10:26:30.189: failed to commit changes to dconf: Unknown or unsupported transport “disabled” for address “disabled:”

(iridium-browser:15381): dconf-WARNING **: 10:26:30.197: failed to commit changes to dconf: Unknown or unsupported transport “disabled” for address “disabled:”

(iridium-browser:15381): dconf-WARNING **: 10:26:30.214: failed to commit changes to dconf: Unknown or unsupported transport “disabled” for address “disabled:”

(iridium-browser:15381): dconf-WARNING **: 10:26:30.230: failed to commit changes to dconf: Unknown or unsupported transport “disabled” for address “disabled:”

(iridium-browser:15381): dconf-WARNING **: 10:26:30.251: failed to commit changes to dconf: Unknown or unsupported transport “disabled” for address “disabled:”

(iridium-browser:15381): dconf-WARNING **: 10:26:30.267: failed to commit changes to dconf: Unknown or unsupported transport “disabled” for address “disabled:”

(iridium-browser:15381): dconf-WARNING **: 10:26:30.281: failed to commit changes to dconf: Unknown or unsupported transport “disabled” for address “disabled:”

(iridium-browser:15381): dconf-WARNING **: 10:26:30.298: failed to commit changes to dconf: Unknown or unsupported transport “disabled” for address “disabled:”

(iridium-browser:15381): dconf-WARNING **: 10:26:30.313: failed to commit changes to dconf: Unknown or unsupported transport “disabled” for address “disabled:”

Hopefully this suggests a solution?

Never mind. Those terminal messages are a red herring. They also show up when there isn’t a problem.

I solved this with an environmental variable:

export G_FILENAME_ENCODING=UTF-8
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.