diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-11-16 08:51:06 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-11-16 08:51:06 +0000 |
commit | 246cd58943ccff6dd50bb10d5e01ea8ba4e2e0f5 (patch) | |
tree | a0e74ddb168b9ae761be003338a0786cdf5f29a0 /src | |
parent | b3ba1ad026ee22d0536ea6800334652394ceca5c (diff) | |
download | gnunet-246cd58943ccff6dd50bb10d5e01ea8ba4e2e0f5.tar.gz gnunet-246cd58943ccff6dd50bb10d5e01ea8ba4e2e0f5.zip |
-change to normalization
Diffstat (limited to 'src')
-rw-r--r-- | src/namestore/namestore.h | 2 | ||||
-rw-r--r-- | src/namestore/namestore_common.c | 12 |
2 files changed, 5 insertions, 9 deletions
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 @@ | |||
32 | #define MAX_NAME_LEN 256 | 32 | #define MAX_NAME_LEN 256 |
33 | 33 | ||
34 | /** | 34 | /** |
35 | * Convert a string from to local codeset to UTF-8 lowercase | 35 | * Convert a UTF-8 string to UTF-8 lowercase |
36 | * @param src source string | 36 | * @param src source string |
37 | * @return converted result | 37 | * @return converted result |
38 | */ | 38 | */ |
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 | |||
72 | GNUNET_NETWORK_STRUCT_END | 72 | GNUNET_NETWORK_STRUCT_END |
73 | 73 | ||
74 | /** | 74 | /** |
75 | * Convert a string from to local codeset to UTF-8 lowercase | 75 | * Convert a UTF-8 string to UTF-8 lowercase |
76 | * @param src source string | 76 | * @param src source string |
77 | * @return converted result | 77 | * @return converted result |
78 | */ | 78 | */ |
79 | char * | 79 | char * |
80 | GNUNET_NAMESTORE_normalize_string (const char *src) | 80 | GNUNET_NAMESTORE_normalize_string (const char *src) |
81 | { | 81 | { |
82 | char *utf_8_str; | ||
83 | |||
84 | GNUNET_assert (NULL != src); | 82 | GNUNET_assert (NULL != src); |
85 | /* Convert to UTF8 */ | 83 | char *res = strdup (src); |
86 | utf_8_str = GNUNET_STRINGS_to_utf8 (src, strlen (src), nl_langinfo (CODESET)); | ||
87 | GNUNET_assert (NULL != utf_8_str); | ||
88 | /* normalize */ | 84 | /* normalize */ |
89 | GNUNET_STRINGS_utf8_tolower(utf_8_str, &utf_8_str); | 85 | GNUNET_STRINGS_utf8_tolower(src, &res); |
90 | return utf_8_str; | 86 | return res; |
91 | } | 87 | } |
92 | 88 | ||
93 | 89 | ||