remove UTF-8 toggle, it's not necessary now with cairo because cairo can

filter invalid unicode
This commit is contained in:
speedie 2023-05-22 20:44:21 +02:00
parent 0258974bf0
commit f482aea8db
5 changed files with 1 additions and 45 deletions

View file

@ -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, "</"))
markup = 0;

View file

@ -71,6 +71,3 @@ void drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h)
/* Powerline functions */
void drw_settrans(Drw *drw, Clr *psc, Clr *nsc);
void drw_arrow(Drw* drw, int x, int y, unsigned int w, unsigned int h, int direction, int slash);
/* UTF-8 functions */
char *parse_utf(char *str, size_t clen);

View file

@ -20,7 +20,6 @@ project_dependencies = [
dependency('cairo'),
dependency('pango'),
dependency('pangocairo'),
dependency('fontconfig'),
cc.find_library('m', required : false),
]
@ -65,10 +64,6 @@ if get_option('xresources')
build_args += [ '-DXRESOURCES' ]
endif
if get_option('utf8')
build_args += [ '-DUTF8' ]
endif
project_target = executable(
meson.project_name(),
project_source_files, install : true,

View file

@ -39,10 +39,3 @@ option(
value : true,
description : 'Enable multi-monitor support using libXinerama'
)
option(
'utf8',
type : 'boolean',
value : true,
description : 'Enable UTF-8 character support'
)

View file

@ -42,7 +42,6 @@ build() {
-Dimlib2="$imlib2" \
-Dopenssl="$openssl" \
-Dlibconfig="$libconfig" \
-Dutf8="$utf8" \
--prefix "$prefix" \
build
else
@ -53,7 +52,6 @@ build() {
-Dimlib2="$imlib2" \
-Dopenssl="$openssl" \
-Dlibconfig="$libconfig" \
-Dutf8="$utf8" \
--prefix "$prefix" \
build
fi