GNOME Bugzilla – Bug 552375
String encoding needed in the GIR.
Last modified: 2015-02-07 16:50:48 UTC
Please describe the problem: string types can be filename encoded and utf8 encoded. An indication of this needs to be included in the GIR. Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information:
Currently the typelib supports both "utf8" and "filename". Do we need any more than those two?
We'll also need binary (uint8), but we have that - for things like: gssize g_output_stream_write (GOutputStream *stream, const void *buffer, gsize count, GCancellable *cancellable, GError **error); gboolean gdk_pixbuf_loader_write (GdkPixbufLoader *loader, const guchar *buf, gsize count, GError **error); I think some stuff like this takes a char* instead of a void*/guchar* but maybe not. I think weird encodings could be treated as binary so utf8 and filename would be the only ones that require special handling.
*** Bug 561253 has been marked as a duplicate of this bug. ***
Created attachment 128684 [details] [review] Bug 552375 - Support (filename) annotation for filename-encoded strings In addition to utf-8, we need a mechanism to express that strings are filename-encoded.
Created attachment 128685 [details] [review] Bug 552375 - Support (filename) annotation for filename-encoded strings In addition to utf-8, we need a mechanism to express that strings are filename-encoded.
Created attachment 128686 [details] [review] Bug 552375 - Support (filename) annotation for filename-encoded strings In addition to utf-8, we need a mechanism to express that strings are filename-encoded.
Comment on attachment 128686 [details] [review] Bug 552375 - Support (filename) annotation for filename-encoded strings I thought about getting rid of utf8 and replace it with (type utf8), which would also handle this case 'out-of-the-box'. I'm sure there are going to be other types we want to override in the future. It's a bit extra work, but should pay off. What do you think?
Sounds good. Note I just did a patch for bug 565147 which makes (type) work better and may in fact just work out of the box for (type filename).
Ok, I've merged the tests from this patch into bug 565147 and verified (type filename) works. *** This bug has been marked as a duplicate of 565147 ***
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]