-change to normalization
authorMatthias Wachs <wachs@net.in.tum.de>
Fri, 16 Nov 2012 08:51:06 +0000 (08:51 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Fri, 16 Nov 2012 08:51:06 +0000 (08:51 +0000)
src/namestore/namestore.h
src/namestore/namestore_common.c

index 42cc2b2d1805090dbce9d9b65771989667aea65c..0e7ecfda3b522f5d6763325b45e768ce0f13c5aa 100644 (file)
@@ -32,7 +32,7 @@
 #define MAX_NAME_LEN 256
 
 /**
- * Convert a string from to local codeset to UTF-8 lowercase
+ * Convert a UTF-8 string to UTF-8 lowercase
  * @param src source string
  * @return converted result
  */
index 4033748096be71c9fe0c5376b99c9ba294757250..f81a287c3de7eb4966c1bf8c768aa6a58103fce5 100644 (file)
@@ -72,22 +72,18 @@ struct NetworkRecord
 GNUNET_NETWORK_STRUCT_END
 
 /**
- * Convert a string from to local codeset to UTF-8 lowercase
+ * Convert a UTF-8 string to UTF-8 lowercase
  * @param src source string
  * @return converted result
  */
 char *
 GNUNET_NAMESTORE_normalize_string (const char *src)
 {
-  char *utf_8_str;
-
   GNUNET_assert (NULL != src);
-  /* Convert to UTF8 */
-  utf_8_str = GNUNET_STRINGS_to_utf8 (src, strlen (src), nl_langinfo (CODESET));
-  GNUNET_assert (NULL != utf_8_str);
+  char *res = strdup (src);
   /* normalize */
-  GNUNET_STRINGS_utf8_tolower(utf_8_str, &utf_8_str);
-  return utf_8_str;
+  GNUNET_STRINGS_utf8_tolower(src, &res);
+  return res;
 }