getChar package:gi-glib

Obtains the character set for the [current locale][setlocale]; you might use this character set as an argument to convert, to convert from the current locale's encoding to some other encoding. (Frequently localeToUtf8 and localeFromUtf8 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. On Linux, the character set is found by consulting nl_langinfo() if available. If not, the environment variables LC_ALL, LC_CTYPE, LANG and CHARSET are queried in order. nl_langinfo() returns the C locale if no locale has been loaded by setlocale(). The return value is True if the locale's encoding is UTF-8, in that case you can perhaps avoid calling convert. The string returned in charset is not allocated, and should not be freed.
Converts a sequence of bytes encoded as UTF-8 to a Unicode character. If p does not point to a valid UTF-8 encoded character, results are undefined. If you are not sure that the bytes are complete valid Unicode characters, you should use utf8GetCharValidated instead.
Convert a sequence of bytes encoded as UTF-8 to a Unicode character. This function checks for incomplete characters, for invalid characters such as characters that are out of the range of Unicode, and for overlong encodings of valid characters. Note that utf8GetCharValidated returns (gunichar)-2 if maxLen is positive and any of the bytes in the first UTF-8 character sequence are nul.