--- a/draw.c Thu Dec 07 09:49:45 2006 +0100
+++ b/draw.c Thu Dec 07 10:02:46 2006 +0100
@@ -2,7 +2,6 @@
* See LICENSE file for license details.
*/
#include "dwm.h"
-#include <locale.h>
#include <stdio.h>
#include <string.h>
@@ -167,16 +166,13 @@
void
setfont(const char *fontstr) {
- char *def, *lc, **missing;
+ char *def, **missing;
int i, n;
- lc = setlocale(LC_CTYPE, NULL);
- setlocale(LC_CTYPE, "UTF-8");
missing = NULL;
if(dc.font.set)
XFreeFontSet(dpy, dc.font.set);
dc.font.set = XCreateFontSet(dpy, fontstr, &missing, &n, &def);
- setlocale(LC_CTYPE, lc);
if(missing) {
while(n--)
fprintf(stderr, "missing fontset: %s\n", missing[n]);
--- a/main.c Thu Dec 07 09:49:45 2006 +0100
+++ b/main.c Thu Dec 07 10:02:46 2006 +0100
@@ -4,6 +4,7 @@
#include "dwm.h"
#include <errno.h>
+#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -240,6 +241,7 @@
}
else if(argc != 1)
eprint("usage: dwm [-v]\n");
+ setlocale(LC_CTYPE, "");
dpy = XOpenDisplay(0);
if(!dpy)
eprint("dwm: cannot open display\n");