diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-12-24 21:40:49 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-12-24 21:40:49 +0000 |
commit | e8d4e1edd97fb8cc6756a953681e1f6a2a5beb68 (patch) | |
tree | 555a58de8662318ef950c1c10a446c023003b7ba /src/include/gnunet_strings_lib.h | |
parent | 8feaaffac09035bd7203d456f5bf96d79fa49be8 (diff) | |
download | gnunet-e8d4e1edd97fb8cc6756a953681e1f6a2a5beb68.tar.gz gnunet-e8d4e1edd97fb8cc6756a953681e1f6a2a5beb68.zip |
-LRN: new charset conversion functions / #2031
Diffstat (limited to 'src/include/gnunet_strings_lib.h')
-rw-r--r-- | src/include/gnunet_strings_lib.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/include/gnunet_strings_lib.h b/src/include/gnunet_strings_lib.h index 4efecc863..edeccaf3b 100644 --- a/src/include/gnunet_strings_lib.h +++ b/src/include/gnunet_strings_lib.h | |||
@@ -87,6 +87,18 @@ GNUNET_STRINGS_byte_size_fancy (unsigned long long size); | |||
87 | 87 | ||
88 | /** | 88 | /** |
89 | * Convert the len characters long character sequence | 89 | * Convert the len characters long character sequence |
90 | * given in input that is in the given input charset | ||
91 | * to a string in given output charset. | ||
92 | * @return the converted string (0-terminated), | ||
93 | * if conversion fails, a copy of the orignal | ||
94 | * string is returned. | ||
95 | */ | ||
96 | char * | ||
97 | GNUNET_STRINGS_conv (const char *input, size_t len, | ||
98 | const char *input_charset, const char *output_charset); | ||
99 | |||
100 | /** | ||
101 | * Convert the len characters long character sequence | ||
90 | * given in input that is in the given charset | 102 | * given in input that is in the given charset |
91 | * to UTF-8. | 103 | * to UTF-8. |
92 | * | 104 | * |
@@ -98,6 +110,17 @@ GNUNET_STRINGS_byte_size_fancy (unsigned long long size); | |||
98 | char * | 110 | char * |
99 | GNUNET_STRINGS_to_utf8 (const char *input, size_t len, const char *charset); | 111 | GNUNET_STRINGS_to_utf8 (const char *input, size_t len, const char *charset); |
100 | 112 | ||
113 | /** | ||
114 | * Convert the len bytes-long UTF-8 string | ||
115 | * given in input to the given charset. | ||
116 | |||
117 | * @return the converted string (0-terminated), | ||
118 | * if conversion fails, a copy of the orignal | ||
119 | * string is returned. | ||
120 | */ | ||
121 | char * | ||
122 | GNUNET_STRINGS_from_utf8 (const char *input, size_t len, const char *charset); | ||
123 | |||
101 | 124 | ||
102 | /** | 125 | /** |
103 | * Complete filename (a la shell) from abbrevition. | 126 | * Complete filename (a la shell) from abbrevition. |