[PATCH] linux: Allow valid UTF-8 encoded string.

Shih-Yuan Lee (FourDollars) sylee at canonical.com
Mon Sep 2 23:43:04 PDT 2013


From: "Shih-Yuan Lee (FourDollars)" <sylee at canonical.com>

---
 src/linux/up-device-supply.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/linux/up-device-supply.c b/src/linux/up-device-supply.c
index cc192c7..fbfaeca 100644
--- a/src/linux/up-device-supply.c
+++ b/src/linux/up-device-supply.c
@@ -441,6 +441,9 @@ up_device_supply_make_safe_string (gchar *text)
 	if (text == NULL)
 		return;
 
+	if (g_utf8_validate (text, -1, NULL) == TRUE)
+		return;
+
 	/* shunt up only safe chars */
 	for (i=0; text[i] != '\0'; i++) {
 		if (g_ascii_isprint (text[i])) {
-- 
1.7.9.5



More information about the devkit-devel mailing list