I use Mac OS X with XFree86 4.3.0 (X_LOCALE defined). While I'm trying to use OpenOffice.org with XFree86, inputting Japanese characters with XIM causes a problem that extra non-needed null characters are inserted after real characters.
I checked OpenOffice.org's source and found that it uses *XIMText->length for calculating XIM characters.
This method works fine on non X_LOCALE XFree86 (e.g. Linux). But on Mac OS X, *XIMText->length is not revised correctly in lib/X11/imCallbk.c since mblen() doesn't calculate multibyte chars appropriately even when Xsetlocale() is called with LANG=ja_JP.eucJP. But if I insert libc's setlocale(LC_CTYPE, "") before using mblen(), *XIMText->length become revised fine and OpenOffice.org's problem disappears. I think my solution is a kind ugly, so I hope any better solutions. Any comments?
Regards, -- Etsushi Kato [EMAIL PROTECTED]
XFree86-4.3.0-imCallbk.c.diff
Description: Binary data
