remove UTF-8 toggle, it's not necessary now with cairo because cairo can
filter invalid unicode
This commit is contained in:
parent
0258974bf0
commit
f482aea8db
|
@ -189,31 +189,6 @@ int xerrordummy(Display *dpy, XErrorEvent *ee) {
|
||||||
return 0;
|
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) {
|
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];
|
char buf[1024];
|
||||||
int ty;
|
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;
|
w -= lpad;
|
||||||
}
|
}
|
||||||
|
|
||||||
t = parse_utf(strdup(text), strlen(text));
|
t = strdup(text);
|
||||||
len = strlen(t);
|
len = strlen(t);
|
||||||
|
|
||||||
if (len) {
|
if (len) {
|
||||||
|
@ -310,8 +285,6 @@ void drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned in
|
||||||
|
|
||||||
char *t = strdup(text);
|
char *t = strdup(text);
|
||||||
|
|
||||||
t = parse_utf(t, len);
|
|
||||||
|
|
||||||
if (!strstr(t, "</"))
|
if (!strstr(t, "</"))
|
||||||
markup = 0;
|
markup = 0;
|
||||||
|
|
||||||
|
|
|
@ -71,6 +71,3 @@ void drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h)
|
||||||
/* Powerline functions */
|
/* Powerline functions */
|
||||||
void drw_settrans(Drw *drw, Clr *psc, Clr *nsc);
|
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);
|
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);
|
|
||||||
|
|
|
@ -20,7 +20,6 @@ project_dependencies = [
|
||||||
dependency('cairo'),
|
dependency('cairo'),
|
||||||
dependency('pango'),
|
dependency('pango'),
|
||||||
dependency('pangocairo'),
|
dependency('pangocairo'),
|
||||||
dependency('fontconfig'),
|
|
||||||
cc.find_library('m', required : false),
|
cc.find_library('m', required : false),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -65,10 +64,6 @@ if get_option('xresources')
|
||||||
build_args += [ '-DXRESOURCES' ]
|
build_args += [ '-DXRESOURCES' ]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if get_option('utf8')
|
|
||||||
build_args += [ '-DUTF8' ]
|
|
||||||
endif
|
|
||||||
|
|
||||||
project_target = executable(
|
project_target = executable(
|
||||||
meson.project_name(),
|
meson.project_name(),
|
||||||
project_source_files, install : true,
|
project_source_files, install : true,
|
||||||
|
|
|
@ -39,10 +39,3 @@ option(
|
||||||
value : true,
|
value : true,
|
||||||
description : 'Enable multi-monitor support using libXinerama'
|
description : 'Enable multi-monitor support using libXinerama'
|
||||||
)
|
)
|
||||||
|
|
||||||
option(
|
|
||||||
'utf8',
|
|
||||||
type : 'boolean',
|
|
||||||
value : true,
|
|
||||||
description : 'Enable UTF-8 character support'
|
|
||||||
)
|
|
||||||
|
|
|
@ -42,7 +42,6 @@ build() {
|
||||||
-Dimlib2="$imlib2" \
|
-Dimlib2="$imlib2" \
|
||||||
-Dopenssl="$openssl" \
|
-Dopenssl="$openssl" \
|
||||||
-Dlibconfig="$libconfig" \
|
-Dlibconfig="$libconfig" \
|
||||||
-Dutf8="$utf8" \
|
|
||||||
--prefix "$prefix" \
|
--prefix "$prefix" \
|
||||||
build
|
build
|
||||||
else
|
else
|
||||||
|
@ -53,7 +52,6 @@ build() {
|
||||||
-Dimlib2="$imlib2" \
|
-Dimlib2="$imlib2" \
|
||||||
-Dopenssl="$openssl" \
|
-Dopenssl="$openssl" \
|
||||||
-Dlibconfig="$libconfig" \
|
-Dlibconfig="$libconfig" \
|
||||||
-Dutf8="$utf8" \
|
|
||||||
--prefix "$prefix" \
|
--prefix "$prefix" \
|
||||||
build
|
build
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue