Skip to contentSkip to conversation

gisi: switch to musl-safe character conversion

PATCH Applied Sicelo A. Mhlongo 2 participants 2 messages Nov 4, 2023 – Nov 6, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gisi: switch to musl-safe character conversion

Support isimodem (gisi) use on musl libc systems by dropping the use of the iconv TRANSLIT extension when converting from UCS2 to UTF-8 [1]

[1] https://wiki.musl-libc.org/functional-differences-from-glibc.html#iconv

---
 gisi/iter.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
gisi/iter.c +2 -2
index 3cc1ae37..74f1c44f 100644
@@ -27,6 +27,7 @@
 #include <string.h>
 #include <glib.h>
 #include <arpa/inet.h>
+#include <ell/ell.h>
 
 #include "iter.h"
 
@@ -257,8 +258,7 @@ gboolean g_isi_sb_iter_get_alpha_tag(const GIsiSubBlockIter *restrict iter,
 	if (ucs2 + len > iter->end)
 		return FALSE;
 
-	*utf8 = g_convert((const char *) ucs2, len, "UTF-8//TRANSLIT",
-				"UCS-2BE", NULL, NULL, NULL);
+	*utf8 = l_utf8_from_ucs2be((const char *) ucs2, len);
 	return *utf8 != NULL;
 }
 
Signature · 1 line
2.42.0