/* Returns: A newly-allocated buffer containing the converted string, or NULL on an error, and error will be set.  */
gchar* g_locale_from_utf8(const gchar *utf8string, gssize len, gsize *bytes_read, gsize *bytes_written, GError **error)
/* Returns: A newly-allocated buffer containing the converted string, or NULL on an error, and error will be set.  */
gchar* g_locale_from_utf8(const gchar *utf8string, gssize len, gsize *bytes_read, gsize *bytes_written, GError **error)
{
  const gchar *charset;
  if (g_get_charset (&charset))
    return strdup_len (utf8string, len, bytes_read, bytes_written, error);
  else
    return g_convert (utf8string, len,
		      charset, "UTF-8", bytes_read, bytes_written, error);
}