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
Status: RESOLVED FIXED
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
URL:
Whiteboard: review+ with trivial change
Keywords: patch
Depends on:
Blocks:
 
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:


Attachments

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.