On Thu, Dec 14, 2006 at 08:19:46AM +0100, Anselm R. Garbe wrote:

> I'm not sure if this is my MUA, but it seems that you send some
> control sequence(s) which erased some data?

No, everything I typed got send (I was in a rush and cut the mail down
to a bare minimum), I only mistyped one Esc-q as Alt-q
which created the stray 'ñ' in the text...

Sander, does the attached patch fix your problems with the character
display under dmenu?  It changes the same thing that helped me to
display Japanese characters in the dwm status bar.

Regards,
Christian

PS: by accident I stumbled across the following:

Using my default locale settings[1] I need the attached patch to
make dmenu print these three selections properly:

[EMAIL PROTECTED]:/tmp$ cat foo
こんばんわäöü FOO 
こんいちわäöü FOO 
おはようäöü FOO 


But if I am using slightly a different locale[2] (I need it for Japanese
character input, but I use it only temporarily) then I don't need the
patch and dmenu displays these selections correctly when using the
Xmb*() functions.

The Xutf8*() functions work in both cases, so perhaps they should be
used by default?


[1]
[EMAIL PROTECTED]:~$ locale
LANG=de_DE.UTF-8
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER="de_DE.UTF-8"
LC_NAME="de_DE.UTF-8"
LC_ADDRESS="de_DE.UTF-8"
LC_TELEPHONE="de_DE.UTF-8"
LC_MEASUREMENT="de_DE.UTF-8"
LC_IDENTIFICATION="de_DE.UTF-8"
LC_ALL=



[2]
[EMAIL PROTECTED]:~$ locale
LANG=de_DE.UTF-8
LC_CTYPE=ja_JP.UTF-8
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER="de_DE.UTF-8"
LC_NAME="de_DE.UTF-8"
LC_ADDRESS="de_DE.UTF-8"
LC_TELEPHONE="de_DE.UTF-8"
LC_MEASUREMENT="de_DE.UTF-8"
LC_IDENTIFICATION="de_DE.UTF-8"
LC_ALL=

(LC_CTYPE is different, that's all)

-- 
....Christian.Garbs.....................................http://www.cgarbs.de

    _    de.alt.rec.ascii-art  ~~~~~~~~~~~~~~~~~~~~~~  .'''''.  .`````.
 __| |__ _ _ _ __ _ ___ __ _    die deutschsprachige   (..)O))) (..)@)))
/ _` / _` | '_/ _` |___/ _` |   ASCII-Art-Newsgruppe   (\/  ))))(\/  ))))
\__,_\__,_|_| \__,_|   \__,_|  ~~~~~~~~~~~~~~~~~~~~~~   \ ## ))) \ oo )))\jrei
diff -Narup 01_dmenu-1.7.1_fixemptylines/draw.c 
02_dmenu-1.7.1_utf8widechars/draw.c
--- 01_dmenu-1.7.1_fixemptylines/draw.c 2006-12-15 17:04:27.000000000 +0100
+++ 02_dmenu-1.7.1_utf8widechars/draw.c 2006-12-15 17:05:30.000000000 +0100
@@ -12,7 +12,7 @@ textnw(const char *text, unsigned int le
        XRectangle r;
 
        if(dc.font.set) {
-               XmbTextExtents(dc.font.set, text, len, NULL, &r);
+               Xutf8TextExtents(dc.font.set, text, len, NULL, &r);
                return r.width;
        }
        return XTextWidth(dc.font.xfont, text, len);
@@ -57,7 +57,7 @@ drawtext(const char *text, unsigned long
        gcv.foreground = col[ColFG];
        if(dc.font.set) {
                XChangeGC(dpy, dc.gc, GCForeground, &gcv);
-               XmbDrawString(dpy, dc.drawable, dc.font.set, dc.gc,
+               Xutf8DrawString(dpy, dc.drawable, dc.font.set, dc.gc,
                                x, y, buf, len);
        }
        else {

Reply via email to