Re: auto-upgrading strings to utf8
- From: Torsten Schoenfeld <kaffeetisch gmx de>
- To: gtk-perl-list gnome org
- Subject: Re: auto-upgrading strings to utf8
- Date: Mon, 06 Jun 2005 19:31:40 +0200
On Mon, 2005-06-06 at 15:40 +0200, Jan Hudec wrote:
Now yes, this is the right solution -- the G_TYPE_STRING must be
supposed to be utf8 for sake of general sanity.
I'm unable to find a single word in the docs that would support this.
GstFileSrc's "location" property gets setup via g_param_spec_string
which creates a GParamSpecString instance. The corresponding GValue's
for GParamSpecString are of type G_TYPE_STRING. g_value_get_string
returns a const gchar*. gchar is just a typedef for char, and the docs
say about it:
Corresponds to the standard C char type.
Then there is GtkFileChooser. gtk_file_chooser_get_filename returns a
gchar*, too. The docs say:
This means that while you can pass the result of
gtk_file_chooser_get_filename() to open(2) or fopen(3), you may not
be able to directly set it as the text of a GtkLabel widget unless
you convert it first to UTF-8, which all GTK+ widgets expect. You
should use g_filename_to_utf8() to convert filenames into strings
that can be passed to GTK+ widgets.
So, no, I don't think the GStreamer library is wrong in assuming that
filenames set via the "location" property are in the correct (i.e.
filesystem) encoding already. But yes, I think we should fix this in
the GStreamer bindings as opposed to Glib or Gtk2. I'll see if the
previously mentioned approach works out.
--
Bye,
-Torsten
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]