Determines the preferred character sets used for filenames.
The first character set from the
charsets is the filename encoding, the
subsequent character sets are used when trying to generate a displayable
representation of a filename, see g_filename_display_name().
On Unix, the character sets are determined by consulting the
On Windows, the character set used in the GLib API is always UTF-8
and said environment variables have no effect.
G_FILENAME_ENCODING may be set to a comma-separated list of
character set names. The special token “`locale
" is taken
to mean the character set for the [current locale][setlocale].
is not set, butG_BROKEN_FILENAMES` is,
the character set of the current locale is taken as the filename
encoding. If neither environment variable is set, UTF-8 is taken
as the filename encoding, but the character set of the current locale
is also put in the list of encodings.
charsets belong to GLib and must not be freed.
Note that on Unix, regardless of the locale character set or
G_FILENAME_ENCODING value, the actual file names present
on a system might be in any random encoding or just gibberish.
Type: An array of
return location for the
NULL-terminated list of encoding names.
The argument will be set by the function. The array must be
The data is owned by the caller of the function. Each element is a NUL terminated UTF-8 string.