diff options
| -rw-r--r-- | draw.c | 6 |
1 files changed, 4 insertions, 2 deletions
| @@ -167,14 +167,16 @@ getcolor(const char *colstr) { | |||
| 167 | 167 | ||
| 168 | void | 168 | void |
| 169 | setfont(const char *fontstr) { | 169 | setfont(const char *fontstr) { |
| 170 | char **missing, *def; | 170 | char *def, *lc, **missing; |
| 171 | int i, n; | 171 | int i, n; |
| 172 | 172 | ||
| 173 | setlocale(LC_CTYPE, ""); | 173 | lc = setlocale(LC_CTYPE, NULL); |
| 174 | setlocale(LC_CTYPE, "UTF-8"); | ||
| 174 | missing = NULL; | 175 | missing = NULL; |
| 175 | if(dc.font.set) | 176 | if(dc.font.set) |
| 176 | XFreeFontSet(dpy, dc.font.set); | 177 | XFreeFontSet(dpy, dc.font.set); |
| 177 | dc.font.set = XCreateFontSet(dpy, fontstr, &missing, &n, &def); | 178 | dc.font.set = XCreateFontSet(dpy, fontstr, &missing, &n, &def); |
| 179 | setlocale(LC_CTYPE, lc); | ||
| 178 | if(missing) { | 180 | if(missing) { |
| 179 | while(n--) | 181 | while(n--) |
| 180 | fprintf(stderr, "missing fontset: %s\n", missing[n]); | 182 | fprintf(stderr, "missing fontset: %s\n", missing[n]); |
