with this patch everything works fine for me
d42c3ba2
2 file(s) · +3 −5
| 2 | 2 | * See LICENSE file for license details. |
|
| 3 | 3 | */ |
|
| 4 | 4 | #include "dwm.h" |
|
| 5 | - | #include <locale.h> |
|
| 6 | 5 | #include <stdio.h> |
|
| 7 | 6 | #include <string.h> |
|
| 8 | 7 | ||
| 167 | 166 | ||
| 168 | 167 | void |
|
| 169 | 168 | setfont(const char *fontstr) { |
|
| 170 | - | char *def, *lc, **missing; |
|
| 169 | + | char *def, **missing; |
|
| 171 | 170 | int i, n; |
|
| 172 | 171 | ||
| 173 | - | lc = setlocale(LC_CTYPE, NULL); |
|
| 174 | - | setlocale(LC_CTYPE, "UTF-8"); |
|
| 175 | 172 | missing = NULL; |
|
| 176 | 173 | if(dc.font.set) |
|
| 177 | 174 | XFreeFontSet(dpy, dc.font.set); |
|
| 178 | 175 | dc.font.set = XCreateFontSet(dpy, fontstr, &missing, &n, &def); |
|
| 179 | - | setlocale(LC_CTYPE, lc); |
|
| 180 | 176 | if(missing) { |
|
| 181 | 177 | while(n--) |
|
| 182 | 178 | fprintf(stderr, "missing fontset: %s\n", missing[n]); |
|
| 4 | 4 | ||
| 5 | 5 | #include "dwm.h" |
|
| 6 | 6 | #include <errno.h> |
|
| 7 | + | #include <locale.h> |
|
| 7 | 8 | #include <stdio.h> |
|
| 8 | 9 | #include <stdlib.h> |
|
| 9 | 10 | #include <string.h> |
|
| 240 | 241 | } |
|
| 241 | 242 | else if(argc != 1) |
|
| 242 | 243 | eprint("usage: dwm [-v]\n"); |
|
| 244 | + | setlocale(LC_CTYPE, ""); |
|
| 243 | 245 | dpy = XOpenDisplay(0); |
|
| 244 | 246 | if(!dpy) |
|
| 245 | 247 | eprint("dwm: cannot open display\n"); |
|