Mercurial > pidgin
comparison libpurple/util.h @ 28101:c9c038529f38
Hmm, g_unichar_isgraph is too restrictive in the characters allowed (it munges \t). Change purple_utf8_strip_unprintables to simply remove ASCII control characters instead.
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Thu, 27 Aug 2009 23:59:30 +0000 |
parents | 8c41a23e6b44 |
children | 63cb8c4f3c66 |
comparison
equal
deleted
inserted
replaced
28100:18e361e0a3ec | 28101:c9c038529f38 |
---|---|
1284 gchar *purple_utf8_salvage(const char *str); | 1284 gchar *purple_utf8_salvage(const char *str); |
1285 | 1285 |
1286 /** | 1286 /** |
1287 * Removes unprintable characters from a UTF-8 string. These characters | 1287 * Removes unprintable characters from a UTF-8 string. These characters |
1288 * (in particular low-ASCII characters) are invalid in XML 1.0 and thus | 1288 * (in particular low-ASCII characters) are invalid in XML 1.0 and thus |
1289 * are not allowed in XMPP and are rejected by libxml2 by default. This | 1289 * are not allowed in XMPP and are rejected by libxml2 by default. |
1290 * function uses g_unichar_isprint to determine what characters should | 1290 * |
1291 * be stripped. The returned string must be freed by the caller. | 1291 * The returned string must be freed by the caller. |
1292 * | 1292 * |
1293 * @param str A valid UTF-8 string. | 1293 * @param str A valid UTF-8 string. |
1294 * | 1294 * |
1295 * @return A newly allocated UTF-8 string without the unprintable characters. | 1295 * @return A newly allocated UTF-8 string without the unprintable characters. |
1296 * @since 2.6.0 | 1296 * @since 2.6.0 |
1297 * | |
1298 * @see g_unichar_isprint | |
1299 */ | 1297 */ |
1300 gchar *purple_utf8_strip_unprintables(const gchar *str); | 1298 gchar *purple_utf8_strip_unprintables(const gchar *str); |
1301 | 1299 |
1302 /** | 1300 /** |
1303 * Return the UTF-8 version of gai_strerror(). It calls gai_strerror() | 1301 * Return the UTF-8 version of gai_strerror(). It calls gai_strerror() |