Hi,
> 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?
To all appearances X_LOCALE was purposed for systems where libc has not
a locale support. If X_LOCALE is defined Xlib replaces setlocale with own
Xsetlocale which just keeps a locale name (and returns it being asked) and
doesn't touch libc's setlocale.
But in such case Xlib should not use any locale-depended functions (such as
mblen) from libc but replace them too with own corresponded functions.
Xlib has such substitutes (e.g _Xmblen for mblen) but it seems they don't
depend on X_LOCALE condition. The fact that in your tests mblen changes its
behaviour when you call libc's setlocale, shows that namely libc's mblen is
used there.
I think the right solution is to add the right condition (replace mblen with
_Xmblen if X_LOCALE is defined) somewhere. Such substitution already is in
Xlib.h but there it depends on another conditions.
On the other hand if in your system selocale works and makes mblen working
correctly, why your Xlib is built with X_LOCALE ?
--
Ivan U. Pascal | e-mail: [EMAIL PROTECTED]
Administrator of | Tomsk State University
University Network | Tomsk, Russia
_______________________________________________
I18n mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/i18n