From f482aea8db75795fd60620851e31f4e62afe0ae8 Mon Sep 17 00:00:00 2001 From: speedie Date: Mon, 22 May 2023 20:44:21 +0200 Subject: [PATCH] remove UTF-8 toggle, it's not necessary now with cairo because cairo can filter invalid unicode --- libs/libdrw/drw.c | 29 +---------------------------- libs/libdrw/drw.h | 3 --- meson.build | 5 ----- meson.options | 7 ------- scripts/make/build.sh | 2 -- 5 files changed, 1 insertion(+), 45 deletions(-) diff --git a/libs/libdrw/drw.c b/libs/libdrw/drw.c index 8ca6ba9..77f6ae4 100644 --- a/libs/libdrw/drw.c +++ b/libs/libdrw/drw.c @@ -189,31 +189,6 @@ int xerrordummy(Display *dpy, XErrorEvent *ee) { return 0; } -char *parse_utf(char *str, size_t clen) { - char *ostr = str; - char *cnstr = calloc(clen + 1, sizeof(char)); - char *cstr = cnstr; - size_t olen = clen; - -#if USEUTF8 - iconv_t cd = iconv_open("UTF-8//IGNORE", "UTF-8"); -#else - iconv_t cd = iconv_open("UTF-8//IGNORE", "ASCII"); -#endif - - if (cd == (iconv_t) - 1) { - die("spmenu: iconv_open failed"); - } - - if (iconv(cd, &ostr, &olen, &cstr, &clen)) { - ; // should be ok - } - - iconv_close(cd); - - return cnstr; -} - int drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert, Bool markup) { char buf[1024]; int ty; @@ -241,7 +216,7 @@ int drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned in w -= lpad; } - t = parse_utf(strdup(text), strlen(text)); + t = strdup(text); len = strlen(t); if (len) { @@ -310,8 +285,6 @@ void drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned in char *t = strdup(text); - t = parse_utf(t, len); - if (!strstr(t, "