Bug 34659

Summary: add an utility function for converting maybe-valid into valid utf8 strings
Product: Telepathy Reporter: Senko Rasic <senko>
Component: tp-glibAssignee: Senko Rasic <senko>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: enhancement    
Priority: medium Keywords: patch
Version: git master   
Hardware: Other   
OS: All   
Whiteboard: review+ with trivial change
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:
  https://bugzilla.gnome.org/show_bug.cgi?id=610969

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:

  http://git.collabora.co.uk/?p=user/ptlo/telepathy-glib/.git;a=shortlog;h=refs/heads/utf8-validation
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.