Re: C character encodings in libgudev and GLibby projects

Allin Cottrell via gnome-devel-list <[email protected]> Mon, 23 Nov 2020 19:04:58 -0500 (EST)
Newsgroups gmane.comp.gnome.devel
Message-ID <[email protected]>
On Mon, 23 Nov 2020, John Scott via gnome-devel-list wrote:

> It's my understanding from the docs that unless specified 
> otherwise, functions in GNOME's realm leverage UTF-8 strings. The 
> (unstable) GLib docs say Glib uses UTF-8 for its strings, and GUI 
> toolkits like GTK+ that use GLib do the same thing. If you get a 
> file name from the file system, for example, from readdir() or 
> from g_dir_read_name(), and you wish to display the file name to 
> the user, you will need to convert it into UTF-8.

Well, only if you're operating on a retro *nix system that doesn't 
use UTF-8. (On Windows the original filenames will not be in UTF-8 
but the ones you get from g* functions will already be converted 
from UTF-16 to UTF-8.)

Allin Cottrell