+2007-12-11 Tim-Philipp Müller <tim at centricular dot net>
+
+ * ext/gnomevfs/Makefile.am:
+ * ext/gnomevfs/gstgnomevfssrc.c: (gst_gnome_vfs_src_unicodify):
+ Use gst_tag_freeform_string_to_utf8() here, which also takes
+ into account any character sets specified by the user via
+ environment variables.
+
2007-12-10 Wim Taymans <wim.taymans@gmail.com>
* gst/audioconvert/Makefile.am:
gstgnomevfssrc.c \
gstgnomevfsuri.c
-libgstgnomevfs_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) $(GNOME_VFS_CFLAGS)
-libgstgnomevfs_la_LIBADD = $(GST_BASE_LIBS) $(GNOME_VFS_LIBS)
+libgstgnomevfs_la_CFLAGS = \
+ $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) $(GNOME_VFS_CFLAGS)
+libgstgnomevfs_la_LIBADD = \
+ $(top_builddir)/gst-libs/gst/tag/libgsttag-$(GST_MAJORMINOR).la \
+ $(GST_BASE_LIBS) $(GNOME_VFS_LIBS)
libgstgnomevfs_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
noinst_HEADERS = \
#include <string.h>
#include <gst/gst.h>
+#include <gst/tag/tag.h>
+
/* gnome-vfs.h doesn't include the following header, which we need: */
#include <libgnomevfs/gnome-vfs-standard-callbacks.h>
}
static char *
-unicodify (const char *str, int len, ...)
-{
- char *ret = NULL, *cset;
- va_list args;
- gsize bytes_read, bytes_written;
-
- if (g_utf8_validate (str, len, NULL))
- return g_strndup (str, len >= 0 ? len : strlen (str));
-
- va_start (args, len);
- while ((cset = va_arg (args, char *)) != NULL)
- {
- if (!strcmp (cset, "locale"))
- ret = g_locale_to_utf8 (str, len, &bytes_read, &bytes_written, NULL);
- else
- ret = g_convert (str, len, "UTF-8", cset,
- &bytes_read, &bytes_written, NULL);
- if (ret)
- break;
- }
- va_end (args);
-
- return ret;
-}
-
-static char *
gst_gnome_vfs_src_unicodify (const char *str)
{
- return unicodify (str, -1, "locale", "ISO-8859-1", NULL);
+ const gchar *env_vars[] = { "GST_ICY_TAG_ENCODING",
+ "GST_TAG_ENCODING", NULL
+ };
+
+ return gst_tag_freeform_string_to_utf8 (str, -1, env_vars);
}
static void