Use g_get_charset instead of g_get_codeset.