# HG changeset patch
# Node ID ffe86ff7ea768bd238ab0e28ff15a61ac5cc54fb
# Parent  000d42c316cb3355fc3712b2d4bc0b6c501c9d85
diff --git a/libpurple/tests/test_util.c b/libpurple/tests/test_util.c
--- a/libpurple/tests/test_util.c
+++ b/libpurple/tests/test_util.c
@@ -40,26 +40,6 @@
 }
 
 /******************************************************************************
- * text_strip tests
- *****************************************************************************/
-static void
-test_util_text_strip_mnemonic(void) {
-	char *result = NULL;
-
-	result = purple_text_strip_mnemonic("");
-	g_assert_cmpstr("", ==, result);
-	g_free(result);
-
-	result = purple_text_strip_mnemonic("foo");
-	g_assert_cmpstr("foo", ==, result);
-	g_free(result);
-
-	result = purple_text_strip_mnemonic("_foo");
-	g_assert_cmpstr("foo", ==, result);
-	g_free(result);
-}
-
-/******************************************************************************
  * email tests
  *****************************************************************************/
 /*
@@ -136,77 +116,6 @@
 }
 
 /******************************************************************************
- * UTF8 tests
- *****************************************************************************/
-typedef struct {
-	gchar *input;
-	gchar *output;
-} UTF8TestData;
-
-static void
-test_util_utf8_strip_unprintables(void) {
-	gint i;
-	UTF8TestData data[] = {
-		{
-			/* \t, \n, \r, space */
-			"ab \tcd\nef\r   ",
-			"ab \tcd\nef\r   ",
-		}, {
-			/* ASCII control characters (stripped) */
-			"\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x0E\x0F\x10 aaaa "
-			"\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F",
-			" aaaa ",
-		}, {
-			/* Basic ASCII */
-			"Foobar",
-			"Foobar",
-		}, {
-			/* 0xE000 - 0xFFFD (UTF-8 encoded) */
-			/* U+F1F7 */
-			"aaaa\xef\x87\xb7",
-			"aaaa\xef\x87\xb7",
-		}, {
-			/* U+FEFF (should not be stripped) */
-			"aaaa\xef\xbb\xbf",
-			"aaaa\xef\xbb\xbf",
-		}, {
-			/* U+FFFE (should be stripped) */
-			"aaaa\xef\xbf\xbe",
-			"aaaa",
-		}, {
-			NULL,
-			NULL,
-		}
-	};
-
-	for(i = 0; ; i++) {
-		gchar *result = purple_utf8_strip_unprintables(data[i].input);
-
-		g_assert_cmpstr(data[i].output, ==, result);
-
-		g_free(result);
-
-		/* NULL as input is a valid test, but it's the last test, so we break
-		 * after it.
-		 */
-		if(data[i].input == NULL)
-			break;
-	}
-}
-
-/******************************************************************************
- * strdup_withhtml tests
- *****************************************************************************/
-static void
-test_util_strdup_withhtml(void) {
-	gchar *result = purple_strdup_withhtml("hi\r\nthere\n");
-
-	g_assert_cmpstr("hi<BR>there<BR>", ==, result);
-
-	g_free(result);
-}
-
-/******************************************************************************
  * MAIN
  *****************************************************************************/
 gint
@@ -216,19 +125,10 @@
 	g_test_add_func("/util/filename/escape",
 	                test_util_filename_escape);
 
-	g_test_add_func("/util/mnemonic/strip",
-	                test_util_text_strip_mnemonic);
-
 	g_test_add_func("/util/email/is valid",
 	                test_util_email_is_valid);
 	g_test_add_func("/util/email/is invalid",
 	                test_util_email_is_invalid);
 
-	g_test_add_func("/util/utf8/strip unprintables",
-	                test_util_utf8_strip_unprintables);
-
-	g_test_add_func("/util/test_strdup_withhtml",
-	                test_util_strdup_withhtml);
-
 	return g_test_run();
 }
diff --git a/libpurple/util.h b/libpurple/util.h
--- a/libpurple/util.h
+++ b/libpurple/util.h
@@ -65,26 +65,6 @@
 /**************************************************************************/
 
 /**
- * purple_util_write_data_to_cache_file:
- * @filename: The basename of the file to write in the purple_cache_dir.
- * @data:     A string of data to write.
- * @size:     The size of the data to save.  If data is
- *                 null-terminated you can pass in -1.
- *
- * Write a string of data to a file of the given name in the Purple
- * cache directory ($HOME/.cache/purple by default).
- * 
- *  See purple_util_write_data_to_file()
- *
- * Returns: TRUE if the file was written successfully.  FALSE otherwise.
- *
- * Since: 3.0
- */
-PURPLE_AVAILABLE_IN_3_0
-gboolean
-purple_util_write_data_to_cache_file(const char *filename, const char *data, gssize size);
-
-/**
  * purple_util_write_data_to_config_file:
  * @filename: The basename of the file to write in the purple_config_dir.
  * @data:     A string of data to write.
@@ -105,47 +85,6 @@
 purple_util_write_data_to_config_file(const char *filename, const char *data, gssize size);
 
 /**
- * purple_util_write_data_to_data_file:
- * @filename: The basename of the file to write in the purple_data_dir.
- * @data:     A string of data to write.
- * @size:     The size of the data to save.  If data is
- *                 null-terminated you can pass in -1.
- *
- * Write a string of data to a file of the given name in the Purple
- * data directory ($HOME/.local/share/purple by default).
- *
- *  See purple_util_write_data_to_file()
- *
- * Returns: TRUE if the file was written successfully.  FALSE otherwise.
- *
- * Since: 3.0
- */
-PURPLE_AVAILABLE_IN_3_0
-gboolean
-purple_util_write_data_to_data_file(const char *filename, const char *data, gssize size);
-
-/**
- * purple_util_read_xml_from_cache_file:
- * @filename:    The basename of the file to open in the purple_cache_dir.
- * @description: A very short description of the contents of this
- *                    file.  This is used in error messages shown to the
- *                    user when the file can not be opened.  For example,
- *                    "preferences," or "buddy pounces."
- *
- * Read the contents of a given file and parse the results into an
- * PurpleXmlNode tree structure.  This is intended to be used to read
- * Purple's cache xml files (xmpp-caps.xml, etc.)
- *
- * Returns: An PurpleXmlNode tree of the contents of the given file.  Or NULL, if
- *         the file does not exist or there was an error reading the file.
- *
- * Since: 3.0
- */
-PURPLE_AVAILABLE_IN_3_0
-PurpleXmlNode *
-purple_util_read_xml_from_cache_file(const char *filename, const char *description);
-
-/**
  * purple_util_read_xml_from_config_file:
  * @filename:    The basename of the file to open in the purple_config_dir.
  * @description: A very short description of the contents of this
@@ -166,27 +105,6 @@
 PurpleXmlNode *
 purple_util_read_xml_from_config_file(const char *filename, const char *description);
 
-/**
- * purple_util_read_xml_from_data_file:
- * @filename:    The basename of the file to open in the purple_data_dir.
- * @description: A very short description of the contents of this
- *                    file.  This is used in error messages shown to the
- *                    user when the file can not be opened.  For example,
- *                    "preferences," or "buddy pounces."
- *
- * Read the contents of a given file and parse the results into an
- * PurpleXmlNode tree structure.  This is intended to be used to read
- * Purple's cache xml files (accounts.xml, etc.)
- *
- * Returns: An PurpleXmlNode tree of the contents of the given file.  Or NULL, if
- *         the file does not exist or there was an error reading the file.
- *
- * Since: 3.0
- */
-PURPLE_AVAILABLE_IN_3_0
-PurpleXmlNode *
-purple_util_read_xml_from_data_file(const char *filename, const char *description);
-
 /**************************************************************************/
 /* Environment Detection Functions                                        */
 /**************************************************************************/
@@ -203,18 +121,6 @@
 PURPLE_AVAILABLE_IN_ALL
 gboolean purple_running_gnome(void);
 
-/**
- * purple_running_kde:
- *
- * Check if running KDE.
- *
- * Returns: TRUE if running KDE, FALSE otherwise.
- *
- * Since: 2.0
- */
-PURPLE_AVAILABLE_IN_ALL
-gboolean purple_running_kde(void);
-
 /**************************************************************************/
 /* String Functions                                                       */
 /**************************************************************************/
@@ -280,34 +186,6 @@
 const char *purple_normalize(PurpleAccount *account, const char *str);
 
 /**
- * purple_validate:
- * @protocol: The protocol the string belongs to.
- * @str:      The string to validate.
- *
- * Checks, if a string is valid.
- *
- * Returns: TRUE, if string is valid, otherwise FALSE.
- *
- * Since: 3.0
- */
-PURPLE_AVAILABLE_IN_3_0
-gboolean purple_validate(PurpleProtocol *protocol, const char *str);
-
-/**
- * purple_strdup_withhtml:
- * @src: The source string.
- *
- * Duplicates a string and replaces all newline characters from the
- * source string with HTML linebreaks.
- *
- * Returns: The new string.  Must be g_free'd by the caller.
- *
- * Since: 2.0
- */
-PURPLE_AVAILABLE_IN_ALL
-gchar *purple_strdup_withhtml(const gchar *src);
-
-/**
  * purple_str_strip_char:
  * @str:     The string to strip characters from.
  * @thechar: The character to strip from the given string.
@@ -325,23 +203,6 @@
 void purple_str_strip_char(char *str, char thechar);
 
 /**
- * purple_util_chrreplace:
- * @string: The string from which to replace stuff.
- * @delimiter: The character you want replaced.
- * @replacement: The character you want inserted in place
- *        of the delimiting character.
- *
- * Given a string, this replaces all instances of one character
- * with another.  This happens inline (the original string IS
- * modified).
- *
- * Since: 2.0
- */
-PURPLE_AVAILABLE_IN_ALL
-void purple_util_chrreplace(char *string, char delimiter,
-						  char replacement);
-
-/**
  * purple_strreplace:
  * @string: The string from which to replace stuff.
  * @delimiter: The substring you want replaced.
@@ -361,20 +222,6 @@
 					   const char *replacement);
 
 /**
- * purple_str_seconds_to_string:
- * @sec: The seconds.
- *
- * Converts seconds into a human-readable form.
- *
- * Returns: A human-readable form, containing days, hours, minutes, and
- *         seconds.
- *
- * Since: 2.0
- */
-PURPLE_AVAILABLE_IN_ALL
-char *purple_str_seconds_to_string(guint sec);
-
-/**
  * purple_str_wipe:
  * @str: A NUL-terminated string to free, or a NULL-pointer.
  *
@@ -422,21 +269,6 @@
 void purple_got_protocol_handler_uri(const char *uri);
 
 /**
- * purple_url_encode:
- * @str: The string to translate.
- *
- * Encodes a URL into an escaped string.
- *
- * This will change non-alphanumeric characters to hex codes.
- *
- * Returns: The resulting string.
- *
- * Since: 2.0
- */
-PURPLE_AVAILABLE_IN_ALL
-const char *purple_url_encode(const char *str);
-
-/**
  * purple_email_is_valid:
  * @address: The email address to validate.
  *
@@ -469,23 +301,6 @@
 gchar *purple_utf8_try_convert(const char *str);
 
 /**
- * purple_utf8_strip_unprintables:
- * @str: A valid UTF-8 string.
- *
- * Removes unprintable characters from a UTF-8 string. These characters
- * (in particular low-ASCII characters) are invalid in XML 1.0 and thus
- * are not allowed in XMPP and are rejected by libxml2 by default.
- *
- * The returned string must be freed by the caller.
- *
- * Returns: A newly allocated UTF-8 string without the unprintable characters.
- *
- * Since: 2.6
- */
-PURPLE_AVAILABLE_IN_2_6
-gchar *purple_utf8_strip_unprintables(const gchar *str);
-
-/**
  * purple_utf8_strcasecmp:
  * @a: The first string.
  * @b: The second string.
@@ -505,36 +320,6 @@
 int purple_utf8_strcasecmp(const char *a, const char *b);
 
 /**
- * purple_utf8_has_word:
- * @haystack: The string to search in.
- * @needle:   The substring to find.
- *
- * Case insensitive search for a word in a string. The needle string
- * must be contained in the haystack string and not be immediately
- * preceded or immediately followed by another alphanumeric character.
- *
- * Returns: TRUE if haystack has the word, otherwise FALSE
- *
- * Since: 2.0
- */
-PURPLE_AVAILABLE_IN_ALL
-gboolean purple_utf8_has_word(const char *haystack, const char *needle);
-
-/**
- * purple_text_strip_mnemonic:
- * @in:  The string to strip
- *
- * Removes the underscore characters from a string used identify the mnemonic
- * character.
- *
- * Returns: The stripped string
- *
- * Since: 2.0
- */
-PURPLE_AVAILABLE_IN_ALL
-char *purple_text_strip_mnemonic(const char *in);
-
-/**
  * purple_escape_filename:
  * @str: The string to translate.
  *
@@ -547,43 +332,6 @@
 PURPLE_AVAILABLE_IN_ALL
 const char *purple_escape_filename(const char *str);
 
-/**
- * purple_value_new:
- * @type:  The type of data to be held by the GValue
- *
- * Creates a new GValue of the specified type.
- *
- * Returns:  The created GValue
- *
- * Since: 2.0
- */
-PURPLE_AVAILABLE_IN_ALL
-GValue *purple_value_new(GType type);
-
-/**
- * purple_value_dup:
- * @value:  The GValue to duplicate
- *
- * Duplicates a GValue.
- *
- * Returns:  The duplicated GValue
- *
- * Since: 2.0
- */
-PURPLE_AVAILABLE_IN_ALL
-GValue *purple_value_dup(GValue *value);
-
-/**
- * purple_value_free:
- * @value:  The GValue to free.
- *
- * Frees a GValue.
- *
- * Since: 3.0
- */
-PURPLE_AVAILABLE_IN_3_0
-void purple_value_free(GValue *value);
-
 G_END_DECLS
 
 #endif /* PURPLE_UTIL_H */
diff --git a/libpurple/util.c b/libpurple/util.c
--- a/libpurple/util.c
+++ b/libpurple/util.c
@@ -89,15 +89,6 @@
 }
 
 gboolean
-purple_util_write_data_to_cache_file(const char *filename, const char *data, gssize size)
-{
-	const char *cache_dir = purple_cache_dir();
-	gboolean ret = purple_util_write_data_to_file_common(cache_dir, filename, data, size);
-
-	return ret;
-}
-
-gboolean
 purple_util_write_data_to_config_file(const char *filename, const char *data, gssize size)
 {
 	const char *config_dir = purple_config_dir();
@@ -106,33 +97,12 @@
 	return ret;
 }
 
-gboolean
-purple_util_write_data_to_data_file(const char *filename, const char *data, gssize size)
-{
-	const char *data_dir = purple_data_dir();
-	gboolean ret = purple_util_write_data_to_file_common(data_dir, filename, data, size);
-
-	return ret;
-}
-
-PurpleXmlNode *
-purple_util_read_xml_from_cache_file(const char *filename, const char *description)
-{
-	return purple_xmlnode_from_file(purple_cache_dir(), filename, description, "util");
-}
-
 PurpleXmlNode *
 purple_util_read_xml_from_config_file(const char *filename, const char *description)
 {
 	return purple_xmlnode_from_file(purple_config_dir(), filename, description, "util");
 }
 
-PurpleXmlNode *
-purple_util_read_xml_from_data_file(const char *filename, const char *description)
-{
-	return purple_xmlnode_from_file(purple_data_dir(), filename, description, "util");
-}
-
 gboolean
 purple_running_gnome(void)
 {
@@ -157,31 +127,6 @@
 #endif
 }
 
-gboolean
-purple_running_kde(void)
-{
-#ifndef _WIN32
-	gchar *tmp = g_find_program_in_path("kfmclient");
-	const char *session;
-
-	if (tmp == NULL)
-		return FALSE;
-	g_free(tmp);
-
-	session = g_getenv("KDE_FULL_SESSION");
-	if (purple_strequal(session, "true"))
-		return TRUE;
-
-	/* If you run Purple from Konsole under !KDE, this will provide a
-	 * a false positive.  Since we do the GNOME checks first, this is
-	 * only a problem if you're running something !(KDE || GNOME) and
-	 * you run Purple from Konsole. This really shouldn't be a problem. */
-	return ((g_getenv("KDEDIR") != NULL) || g_getenv("KDEDIRS") != NULL);
-#else
-	return FALSE;
-#endif
-}
-
 /**************************************************************************
  * String Functions
  **************************************************************************/
@@ -217,60 +162,6 @@
 	return ret;
 }
 
-gboolean
-purple_validate(PurpleProtocol *protocol, const char *str)
-{
-	const char *normalized;
-
-	g_return_val_if_fail(protocol != NULL, FALSE);
-	g_return_val_if_fail(str != NULL, FALSE);
-
-	if (str[0] == '\0')
-		return FALSE;
-
-	if (!PURPLE_PROTOCOL_IMPLEMENTS(protocol, CLIENT, normalize))
-		return TRUE;
-
-	normalized = purple_protocol_client_normalize(PURPLE_PROTOCOL_CLIENT(protocol),
-	                                              NULL, str);
-
-	return (NULL != normalized);
-}
-
-gchar *
-purple_strdup_withhtml(const gchar *src)
-{
-	gulong destsize, i, j;
-	gchar *dest;
-
-	g_return_val_if_fail(src != NULL, NULL);
-
-	/* New length is (length of src) + (number of \n's * 3) - (number of \r's) + 1 */
-	destsize = 1;
-	for (i = 0; src[i] != '\0'; i++)
-	{
-		if (src[i] == '\n')
-			destsize += 4;
-		else if (src[i] != '\r')
-			destsize++;
-	}
-
-	dest = g_malloc(destsize);
-
-	/* Copy stuff, ignoring \r's, because they are dumb */
-	for (i = 0, j = 0; src[i] != '\0'; i++) {
-		if (src[i] == '\n') {
-			strcpy(&dest[j], "<BR>");
-			j += 4;
-		} else if (src[i] != '\r')
-			dest[j++] = src[i];
-	}
-
-	dest[destsize-1] = '\0';
-
-	return dest;
-}
-
 void
 purple_str_strip_char(char *text, char thechar)
 {
@@ -285,22 +176,6 @@
 	text[j] = '\0';
 }
 
-void
-purple_util_chrreplace(char *string, char delimiter,
-					 char replacement)
-{
-	int i = 0;
-
-	g_return_if_fail(string != NULL);
-
-	while (string[i] != '\0')
-	{
-		if (string[i] == delimiter)
-			string[i] = replacement;
-		i++;
-	}
-}
-
 gchar *
 purple_strreplace(const char *string, const char *delimiter,
 				const char *replacement)
@@ -319,78 +194,6 @@
 	return ret;
 }
 
-char *
-purple_str_seconds_to_string(guint secs)
-{
-	char *ret = NULL;
-	guint days, hrs, mins;
-
-	if(secs < 60) {
-		const char *format;
-
-		format = dngettext(GETTEXT_PACKAGE, "%d second", "%d seconds", secs);
-
-		return g_strdup_printf(format, secs);
-	}
-
-	days = secs / (60 * 60 * 24);
-	secs = secs % (60 * 60 * 24);
-	hrs  = secs / (60 * 60);
-	secs = secs % (60 * 60);
-	mins = secs / 60;
-	/* secs = secs % 60; */
-
-	if(days > 0) {
-		const char *format;
-
-		format = dngettext(GETTEXT_PACKAGE, "%d day", "%d days", days);
-
-		ret = g_strdup_printf(format, days);
-	}
-
-	if(hrs > 0) {
-		if(ret != NULL) {
-			char *tmp = NULL;
-			const char *format;
-
-			format = dngettext(GETTEXT_PACKAGE, "%s, %d hour", "%s, %d hours",
-			                   hrs);
-
-			tmp = g_strdup_printf(format, ret, hrs);
-			g_free(ret);
-			ret = tmp;
-		} else {
-			const char *format;
-
-			format = dngettext(GETTEXT_PACKAGE, "%d hour", "%d hours", hrs);
-
-			ret = g_strdup_printf(format, hrs);
-		}
-	}
-
-	if(mins > 0) {
-		if (ret != NULL) {
-			char *tmp;
-			const char *format;
-
-			format = dngettext(GETTEXT_PACKAGE, "%s, %d minute",
-			                   "%s, %d minutes", mins);
-			tmp = g_strdup_printf(format, ret, mins);
-			g_free(ret);
-			ret = tmp;
-		} else {
-			const char *format;
-
-			format = dngettext(GETTEXT_PACKAGE, "%d minute", "%d minutes",
-			                   mins);
-
-			ret = g_strdup_printf(format, mins);
-		}
-	}
-
-	return ret;
-}
-
 void
 purple_str_wipe(gchar *str)
 {
@@ -540,44 +343,6 @@
 	g_clear_pointer(&params, g_hash_table_destroy);
 }
 
-const char *
-purple_url_encode(const char *str)
-{
-	const char *iter;
-	static char buf[BUF_LEN];
-	char utf_char[6];
-	guint i, j = 0;
-
-	g_return_val_if_fail(str != NULL, NULL);
-	g_return_val_if_fail(g_utf8_validate(str, -1, NULL), NULL);
-
-	iter = str;
-	for (; *iter && j < (BUF_LEN - 1) ; iter = g_utf8_next_char(iter)) {
-		gunichar c = g_utf8_get_char(iter);
-		/* If the character is an ASCII character and is alphanumeric
-		 * no need to escape */
-		if (c < 128 && (isalnum(c) || c == '-' || c == '.' || c == '_' || c == '~')) {
-			buf[j++] = c;
-		} else {
-			int bytes = g_unichar_to_utf8(c, utf_char);
-			for (i = 0; (int)i < bytes; i++) {
-				if (j > (BUF_LEN - 4))
-					break;
-				if (i >= sizeof(utf_char)) {
-					g_warn_if_reached();
-					break;
-				}
-				sprintf(buf + j, "%%%02X", utf_char[i] & 0xff);
-				j += 3;
-			}
-		}
-	}
-
-	buf[j] = '\0';
-
-	return buf;
-}
-
 /* Originally lifted from
  * http://www.oreillynet.com/pub/a/network/excerpt/spcookbook_chap03/index3.html
  * ... and slightly modified to be a bit more rfc822 compliant
@@ -666,48 +431,6 @@
 	return NULL;
 }
 
-gchar *
-purple_utf8_strip_unprintables(const gchar *str)
-{
-	gchar *workstr, *iter;
-	const gchar *bad;
-
-	if (str == NULL)
-		/* Act like g_strdup */
-		return NULL;
-
-	if (!g_utf8_validate(str, -1, &bad)) {
-		purple_debug_error("util", "purple_utf8_strip_unprintables(%s) failed; "
-		                           "first bad character was %02x (%c)\n",
-		                   str, *bad, *bad);
-		g_return_val_if_reached(NULL);
-	}
-
-	workstr = iter = g_new(gchar, strlen(str) + 1);
-	while (*str) {
-		gunichar ch = g_utf8_get_char(str);
-		gchar *next = g_utf8_next_char(str);
-		/*
-		 * Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] |
-		 *          [#x10000-#x10FFFF]
-		 */
-		if ((ch == '\t' || ch == '\n' || ch == '\r') ||
-				(ch >= 0x20 && ch <= 0xD7FF) ||
-				(ch >= 0xE000 && ch <= 0xFFFD) ||
-				(ch >= 0x10000 && ch <= 0x10FFFF)) {
-			memcpy(iter, str, next - str);
-			iter += (next - str);
-		}
-
-		str = next;
-	}
-
-	/* nul-terminate the new string */
-	*iter = '\0';
-
-	return workstr;
-}
-
 int
 purple_utf8_strcasecmp(const char *a, const char *b)
 {
@@ -738,110 +461,6 @@
 	return ret;
 }
 
-/* previously conversation::find_nick() */
-gboolean
-purple_utf8_has_word(const char *haystack, const char *needle)
-{
-	char *hay, *pin, *p;
-	const char *start, *prev_char;
-	gunichar before, after;
-	int n;
-	gboolean ret = FALSE;
-
-	start = hay = g_utf8_strdown(haystack, -1);
-
-	pin = g_utf8_strdown(needle, -1);
-	n = strlen(pin);
-
-	while ((p = strstr(start, pin)) != NULL) {
-		prev_char = g_utf8_find_prev_char(hay, p);
-		before = -2;
-		if (prev_char) {
-			before = g_utf8_get_char(prev_char);
-		}
-		after = g_utf8_get_char_validated(p + n, - 1);
-
-		if ((p == hay ||
-				/* The character before is a reasonable guess for a word boundary
-				   ("!g_unichar_isalnum()" is not a valid way to determine word
-				    boundaries, but it is the only reasonable thing to do here),
-				   and isn't the '&' from a "&amp;" or some such entity*/
-				(before != (gunichar)-2 && !g_unichar_isalnum(before) && *(p - 1) != '&'))
-				&& after != (gunichar)-2 && !g_unichar_isalnum(after)) {
-			ret = TRUE;
-			break;
-		}
-		start = p + 1;
-	}
-
-	g_free(pin);
-	g_free(hay);
-
-	return ret;
-}
-
-
-char *purple_text_strip_mnemonic(const char *in)
-{
-	char *out;
-	char *a;
-	char *a0;
-	const char *b;
-
-	g_return_val_if_fail(in != NULL, NULL);
-
-	out = g_malloc(strlen(in)+1);
-	a = out;
-	b = in;
-
-	a0 = a; /* The last non-space char seen so far, or the first char */
-
-	while(*b) {
-		if(*b == '_') {
-			if(a > out && b > in && *(b-1) == '(' && *(b+1) && !(*(b+1) & 0x80) && *(b+2) == ')') {
-				/* Detected CJK style shortcut (Bug 875311) */
-				a = a0;	/* undo the left parenthesis */
-				b += 3;	/* and skip the whole mess */
-			} else if(*(b+1) == '_') {
-				*(a++) = '_';
-				b += 2;
-				a0 = a;
-			} else {
-				b++;
-			}
-		/* We don't want to corrupt the middle of UTF-8 characters */
-		} else if (!(*b & 0x80)) {	/* other 1-byte char */
-			if (*b != ' ')
-				a0 = a;
-			*(a++) = *(b++);
-		} else {
-			/* Multibyte utf8 char, don't look for _ inside these */
-			int n = 0;
-			int i;
-			if ((*b & 0xe0) == 0xc0) {
-				n = 2;
-			} else if ((*b & 0xf0) == 0xe0) {
-				n = 3;
-			} else if ((*b & 0xf8) == 0xf0) {
-				n = 4;
-			} else if ((*b & 0xfc) == 0xf8) {
-				n = 5;
-			} else if ((*b & 0xfe) == 0xfc) {
-				n = 6;
-			} else {		/* Illegal utf8 */
-				n = 1;
-			}
-			a0 = a; /* unless we want to delete CJK spaces too */
-			for (i = 0; i < n && *b; i += 1) {
-				*(a++) = *(b++);
-			}
-		}
-	}
-	*a = '\0';
-
-	return out;
-}
-
 /* this is almost identical to purple_url_encode (hence purple_url_decode
  * being used above), but we want to keep certain characters unescaped
  * for compat reasons */
@@ -889,39 +508,3 @@
 
 	return buf;
 }
-
-GValue *
-purple_value_new(GType type)
-{
-	GValue *ret;
-
-	g_return_val_if_fail(type != G_TYPE_NONE, NULL);
-
-	ret = g_new0(GValue, 1);
-	g_value_init(ret, type);
-
-	return ret;
-}
-
-GValue *
-purple_value_dup(GValue *value)
-{
-	GValue *ret;
-
-	g_return_val_if_fail(value != NULL, NULL);
-
-	ret = g_new0(GValue, 1);
-	g_value_init(ret, G_VALUE_TYPE(value));
-	g_value_copy(value, ret);
-
-	return ret;
-}
-
-void
-purple_value_free(GValue *value)
-{
-	g_return_if_fail(value != NULL);
-
-	g_value_unset(value);
-	g_free(value);
-}
