Bug 34659 - add an utility function for converting maybe-valid into valid utf8 strings
Summary: add an utility function for converting maybe-valid into valid utf8 strings
Alias: None
Product: Telepathy
Classification: Unclassified
Component: tp-glib (show other bugs)
Version: git master
Hardware: Other All
: medium enhancement
Assignee: Senko Rasic
QA Contact: Telepathy bugs list
Whiteboard: review+ with trivial change
Keywords: patch
Depends on:
Reported: 2011-02-24 04:26 UTC by Senko Rasic
Modified: 2011-02-24 05:22 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Description Senko Rasic 2011-02-24 04:26:49 UTC
Applications taking data that's supposed to be UTF8 from outside, and passing around to other components in DBus need to validate the data so they're sure they're passing valid UTF8.

There's an utility function to do so in glib, but at the moment it's not publicly visible, and there are some ambiguities over how to model the public API for it. See the discussion here:

Until such a function is available to glib, we could add it to telepathy-glib. Since both libraries are under LGPL, we can just copy the code verbatim, and expose it.
Comment 1 Senko Rasic 2011-02-24 04:27:38 UTC
Here's my branch that does this:

Comment 2 Simon McVittie 2011-02-24 04:40:00 UTC
> + * This method is a verbatim copy of glib's internal
> + * g_utf8_make_valid() function, and will be deprecated as

_g_utf8_make_valid. Other than that, r+
Comment 3 Jonny Lamb 2011-02-24 05:21:32 UTC
You forgot to add the new function name to the gtk-doc sections file.
Comment 4 Senko Rasic 2011-02-24 05:22:58 UTC
Simon, Jonny: thanks, fixed and merged.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.