aboutsummaryrefslogtreecommitdiff
path: root/src/util/strings.c
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2022-01-18 11:05:41 +0100
committerMartin Schanzenbach <schanzen@gnunet.org>2022-01-18 11:05:41 +0100
commit54554ca531d018b965cc04fe5046e7df68eb27f9 (patch)
treec2c2128b3465f80d355a0d97d9c5ac30e5b01c91 /src/util/strings.c
parent56b8101fe913c113fdb9fa2f9149861752bbea12 (diff)
downloadgnunet-54554ca531d018b965cc04fe5046e7df68eb27f9.tar.gz
gnunet-54554ca531d018b965cc04fe5046e7df68eb27f9.zip
GNS: Towards NFC
Diffstat (limited to 'src/util/strings.c')
-rw-r--r--src/util/strings.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/util/strings.c b/src/util/strings.c
index 76125b92e..ece096f72 100644
--- a/src/util/strings.c
+++ b/src/util/strings.c
@@ -427,6 +427,23 @@ GNUNET_STRINGS_from_utf8 (const char *input,
427 427
428 428
429void 429void
430GNUNET_STRINGS_utf8_normalize (const char *input,
431 char *output)
432{
433 uint8_t *tmp;
434 size_t len;
435
436 tmp = u8_normalize (UNINORM_NFC,
437 (uint8_t *) input,
438 strlen ((char*) input),
439 NULL,
440 &len);
441 GNUNET_memcpy (output, tmp, len);
442 output[len] = '\0';
443 free (tmp);
444}
445
446void
430GNUNET_STRINGS_utf8_tolower (const char *input, 447GNUNET_STRINGS_utf8_tolower (const char *input,
431 char *output) 448 char *output)
432{ 449{