On Sun, Mar 16, 2003 at 07:19:58PM +0100, Per Olofsson wrote: > So, how am I supposed to package this? If I compile with UTF-8 > enabled, it will break for users who hasn't set up their locales > "properly" (whatever that means). But if I don't, those who want UTF-8 > will have to recompile it and that's not very good either. Isn't it > possible to check for this at runtime or anything?
Actually, the latest version of Ion fails to start in any case if locales aren't set up "properly" or not set up at all because X refuses to load any fonts if setlocale() has been called with any settings it doesn't like. Ion tries to ask with XSetLocale() if X likes the settings but apparently it doesn't usually complain. If it did, locale would be reset to "POSIX" and all would be okay. To go around this, the setlocale() block in ioncore_init (ioncore/ioncore.c) should be made dependent on CF_UTF8. I could also add code to try load the "fixed" font at startup and complain and reset to "POSIX" if that fails, but I'm not sure if that would cause problems with some locales/character sets. Also, this is not a solution to providing only an utf8 version of Ion, because the UTF8 X functions will stop processing everything non-ascii if locales aren't set up (as with gtk apps). Without UTF8 support non-ascii characters should work well enough even if no locales are set up. Only the line editor's skip/delete word commands should be affected. As mentioned, the UTF8 support is considered very experimental, so at the moment I suggest not including that support in prepackaged binaries and making the above mentioned modification to ioncore.c. It might be possible to provide a separate ion-devel-utf8 package, but it would not necessarily be very long-lived so I don't suggest doing so yet. -- Tuomo
