GLib.get_charset

function get_charset(charset: String): Boolean {
    // Gjs wrapper for g_get_charset()
}
  

Obtains the character set for the [current locale][setlocale]; you might use this character set as an argument to GLib.convert, to convert from the current locale's encoding to some other encoding. (Frequently GLib.locale_to_utf8 and GLib.locale_from_utf8 are nice shortcuts, though.)

On Windows the character set returned by this function is the so-called system default ANSI code-page. That is the character set used by the "narrow" versions of C library and Win32 functions that handle file names. It might be different from the character set used by the C library's current locale.

The return value is true if the locale's encoding is UTF-8, in that case you can perhaps avoid calling GLib.convert.

The string returned in charset is not allocated, and should not be freed.

charset

return location for character set name

Returns

true if the returned charset is UTF-8