Re: I18n floating point conversions


Subject: Re: I18n floating point conversions
From: Vlad Harchev (hvv@hippo.ru)
Date: Tue Nov 21 2000 - 04:19:05 CST


On Mon, 20 Nov 2000, Mike Nordell wrote:

> If any of the following is just my ignorance, please state so and just point
> me in the right direction.
>
> Do we currently have some functions to convert to/from floating point text
> representation in an i18n fashion?
>
> In e.g. Germany and Sweden the non-computer world use e.g. "1,72", when we
> computer users use "1.72" (comma vs. dot). I'd assume some function using
> localeconv() or setlocale(), but searching the sources for these strings I
> found nothing helpful.

 At least under linux *printf() and *scanf() use proper separators on my box..
Dunno what Win* uses. Under unix, that *printf behaviour could be dangerous
since it can lead to generation of .ps files that can't be parsed by PS
interpreters (AW has a means to overcome it - i.e. using "." as fraction
separator).

> I'm now facing this problem in the lists dialog, and just wanted to know if
> this problem is already solved by some other means in AW.

 What problem did you face? That under Win* "." is unconditionally used as
fraction separator for any locale? Is it only aestetical problem? If yes, I
think windows users can live with it.

> Perhaps this post only boils down to "Is there a way to convert from AW
> internal language representation to the C language representation of locales
> (to be used in setlocale())".

 Do you mean "how to construct string that can be used as locale name for
'setlocale'"? If yes, XAP_EncodingManager already provides this info (provided
someone wrote backend for windows).

> localeconv() and also C++ standard library takes care of this, but
> unfortunately we're currently forbidden to use the standard C++ library (for
> one thing it uses templates) and the lack of proper localeconv() and
> setlocale() in the code makes me think that this is perhaps a new issue.
>
> If it indeed is a new issue, I'd have to say that 0.7.12 would have to be
> released without Win32 Lists dialog (to be released anytime soon). Also,
> should this be the case, it would probably need a release note stating this
> problem.
>
> /Mike - please don't cc
>

 Best regards,
  -Vlad



This archive was generated by hypermail 2b25 : Tue Nov 21 2000 - 04:47:59 CST