[ic] cut off fractionals after changing locale

Mike Heins interchange-users@icdevgroup.org
Thu Nov 14 10:23:01 2002


Quoting Christian Ducrot (newsletter@pressreturn.de):
> MH> Set your LC_ALL to "C" before starting IC. For example:
> 
> MH>         $ export LC_ALL=C; bin/interchange -restart
> 
> MH>         or 
> 
> MH>         % setenv LC_ALL C; bin/interchange -restart
> 
> MH> Or if you have a catalog.cfg setup that works for you, put it back
> MH> that way and then put in catalog.cfg as well:
> 
> MH>         ScratchDefault  mv_locale de_DE
> 
> The problem still exist with LC_ALL=C.
> 
> I get different results if I use more then one catalog:
> 
> this don't work (cut off fractional) as first catalog:
> Locale          de_DE default 1
> LocaleDatabase  locale
> ScratchDefault  mv_locale de_DE
> 
> this work as second catalog (first one is Locale en_US):
> Locale          de_DE default 1
> LocaleDatabase  locale
> ScratchDefault  mv_locale de_DE
> 
> this work in every situation:
> Locale          en_US default 1
> LocaleDatabase  locale
> ScratchDefault  mv_locale de_DE
> 
> Can you please explain me that behavior?

The problem is that you are having is that no setlocale is being done
and it is not being set to the proper execution locale -- you start in
locale de_DE, and the en_US or C locale is never being set. I am
beginning to think this is becoming a major problem for IC and non-US
users who don't operate in the C locale.

I cannot duplicate the problem, myself. I have tried bringing up
a shell in de_DE and getting it to fail, and cannot. Apparently I don't
have the proper setup, and would need to enable that locale at Linux
installation time.

To ensure that there is no problem, you should do in every catalog
as your last two lines setting locale stuff:

  Locale C default 0
  ScratchDefault  mv_locale de_DE

I am fixing this in 4.9 by a new ExecutionLocale and DefaultLocale
directive, and doing an explicit setlocale to the ExecutionLocale, but
probably we will stay with what we have in 4.8 as I am afraid of
side-effects in systems that are working.

Perhaps you can try hacking the source and putting at the top of
bin/interchange routine dispatch:

	POSIX::setlocale('LC_ALL', 'C');

That should ensure the proper execution locale at all times.

-- 
Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.513.523.7621      <mike@perusion.com>

"Laughter is inner jogging." -- Norman Cousins