# HG changeset patch
# Node ID 12b4a8ff03a4
# Parent  281bd12a66f7
diff --git a/ChangeLog.API b/ChangeLog.API
--- a/ChangeLog.API
+++ b/ChangeLog.API
@@ -593,6 +593,7 @@
 		* purple_network_listen_range_family
 		* purple_network_remove_port_mapping
 		* purple_network_set_turn_server
+		* purple_normalize_nocase
 		* PurpleNotifyUiOps.notify_email
 		* PurpleNotifyUiOps.notify_emails
 		* purple_notify_email
@@ -829,6 +830,7 @@
 		* purple_status_type_add_attrs_vargs
 		* purple_status_type_get_primary_attr
 		* purple_status_type_set_primary_attr
+		* purple_str_has_caseprefix
 		* purple_strcasestr
 		* purple_strlcat
 		* purple_strlcpy
@@ -853,6 +855,8 @@
 		* purple_uri_list_extract_uris
 		* purple_url_decode
 		* purple_user_dir
+		* purple_utf8_ncr_decode
+		* purple_utf8_ncr_encode
 		* purple_utf8_salvage.  Use g_utf8_make_valid instead.
 		* purple_utf8_strftime
 		* purple_util_write_data_to_file_absolute.  Use g_file_set_contents
diff --git a/libpurple/util.h b/libpurple/util.h
--- a/libpurple/util.h
+++ b/libpurple/util.h
@@ -246,20 +246,6 @@
 const char *purple_normalize(PurpleAccount *account, const char *str);
 
 /**
- * purple_normalize_nocase:
- * @str:      The string to normalize.
- *
- * Normalizes a string, so that it is suitable for comparison.
- *
- * This is one possible implementation for the protocol callback
- * function "normalize."  It returns a lowercase and UTF-8
- * normalized version of the string.
- *
- * Returns: A pointer to the normalized version stored in a static buffer.
- */
-const char *purple_normalize_nocase(const char *str);
-
-/**
  * purple_validate:
  * @protocol: The protocol the string belongs to.
  * @str:      The string to validate.
@@ -271,19 +257,6 @@
 gboolean purple_validate(PurpleProtocol *protocol, const char *str);
 
 /**
- * purple_str_has_caseprefix:
- * @s: The string to check.
- * @p: The prefix in question.
- *
- * Compares two strings to see if the first contains the second as
- * a proper case-insensitive prefix.
- *
- * Returns: %TRUE if @p is a prefix of @s, otherwise %FALSE.
- */
-gboolean
-purple_str_has_caseprefix(const gchar *s, const gchar *p);
-
-/**
  * purple_strdup_withhtml:
  * @src: The source string.
  *
@@ -338,34 +311,6 @@
 gchar *purple_strreplace(const char *string, const char *delimiter,
 					   const char *replacement);
 
-
-/**
- * purple_utf8_ncr_encode:
- * @in: The string which might contain utf-8 substrings
- *
- * Given a string, this replaces any utf-8 substrings in that string with
- * the corresponding numerical character reference, and returns a newly
- * allocated string.
- *
- * Returns: A new string, with utf-8 replaced with numerical character
- *         references, free this with g_free()
-*/
-char *purple_utf8_ncr_encode(const char *in);
-
-
-/**
- * purple_utf8_ncr_decode:
- * @in: The string which might contain numerical character references.
- *
- * Given a string, this replaces any numerical character references
- * in that string with the corresponding actual utf-8 substrings,
- * and returns a newly allocated string.
- *
- * Returns: A new string, with numerical character references
- *         replaced with actual utf-8, free this with g_free().
- */
-char *purple_utf8_ncr_decode(const char *in);
-
 /**
  * purple_str_seconds_to_string:
  * @sec: The seconds.
diff --git a/libpurple/util.c b/libpurple/util.c
--- a/libpurple/util.c
+++ b/libpurple/util.c
@@ -208,28 +208,6 @@
 	return ret;
 }
 
-/*
- * You probably don't want to call this directly, it is
- * mainly for use as a protocol callback function.  See the
- * comments in util.h.
- */
-const char *
-purple_normalize_nocase(const char *str)
-{
-	static char buf[BUF_LEN];
-	char *tmp1, *tmp2;
-
-	g_return_val_if_fail(str != NULL, NULL);
-
-	tmp1 = g_utf8_strdown(str, -1);
-	tmp2 = g_utf8_normalize(tmp1, -1, G_NORMALIZE_DEFAULT);
-	g_snprintf(buf, sizeof(buf), "%s", tmp2 ? tmp2 : "");
-	g_free(tmp2);
-	g_free(tmp1);
-
-	return buf;
-}
-
 gboolean
 purple_validate(PurpleProtocol *protocol, const char *str)
 {
@@ -284,15 +262,6 @@
 	return dest;
 }
 
-gboolean
-purple_str_has_caseprefix(const gchar *s, const gchar *p)
-{
-	g_return_val_if_fail(s, FALSE);
-	g_return_val_if_fail(p, FALSE);
-
-	return (g_ascii_strncasecmp(s, p, strlen(p)) == 0);
-}
-
 void
 purple_str_strip_char(char *text, char thechar)
 {
@@ -712,75 +681,6 @@
 	return workstr;
 }
 
-char *
-purple_utf8_ncr_encode(const char *str)
-{
-	GString *out;
-
-	g_return_val_if_fail(str != NULL, NULL);
-	g_return_val_if_fail(g_utf8_validate(str, -1, NULL), NULL);
-
-	out = g_string_new("");
-
-	for(; *str; str = g_utf8_next_char(str)) {
-		gunichar wc = g_utf8_get_char(str);
-
-		/* super simple check. hopefully not too wrong. */
-		if(wc >= 0x80) {
-			g_string_append_printf(out, "&#%u;", (guint32) wc);
-		} else {
-			g_string_append_unichar(out, wc);
-		}
-	}
-
-	return g_string_free(out, FALSE);
-}
-
-
-char *
-purple_utf8_ncr_decode(const char *str)
-{
-	GString *out;
-	char *buf, *b;
-
-	g_return_val_if_fail(str != NULL, NULL);
-	g_return_val_if_fail(g_utf8_validate(str, -1, NULL), NULL);
-
-	buf = (char *) str;
-	out = g_string_new("");
-
-	while( (b = strstr(buf, "&#")) ) {
-		gunichar wc;
-		int base = 0;
-
-		/* append everything leading up to the &# */
-		g_string_append_len(out, buf, b-buf);
-
-		b += 2; /* skip past the &# */
-
-		/* strtoul will treat 0x prefix as hex, but not just x */
-		if(*b == 'x' || *b == 'X') {
-			base = 16;
-			b++;
-		}
-
-		/* advances buf to the end of the ncr segment */
-		wc = (gunichar) strtoul(b, &buf, base);
-
-		/* this mimics the previous impl of ncr_decode */
-		if(*buf == ';') {
-			g_string_append_unichar(out, wc);
-			buf++;
-		}
-	}
-
-	/* append whatever's left */
-	g_string_append(out, buf);
-
-	return g_string_free(out, FALSE);
-}
-
-
 int
 purple_utf8_strcasecmp(const char *a, const char *b)
 {
