From: Matthias Wachs Date: Fri, 16 Nov 2012 08:51:06 +0000 (+0000) Subject: -change to normalization X-Git-Tag: initial-import-from-subversion-38251~10828 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=246cd58943ccff6dd50bb10d5e01ea8ba4e2e0f5;p=oweals%2Fgnunet.git -change to normalization --- diff --git a/src/namestore/namestore.h b/src/namestore/namestore.h index 42cc2b2d1..0e7ecfda3 100644 --- a/src/namestore/namestore.h +++ b/src/namestore/namestore.h @@ -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 */ diff --git a/src/namestore/namestore_common.c b/src/namestore/namestore_common.c index 403374809..f81a287c3 100644 --- a/src/namestore/namestore_common.c +++ b/src/namestore/namestore_common.c @@ -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; }