Re: setlocale


Subject: Re: setlocale
From: Dom Lachowicz (cinamod@hotmail.com)
Date: Tue Apr 17 2001 - 10:09:38 CDT


Jskov wrote:
> > This should be documented somewhere! In the coding standard even, I
> > think. A developer starting tomorrow will have missed your message.

Yes, I think that this would be a good thing. I'll add it later today.

Thomasf wrote:
>Even better, this should have a UT wrapper. Doing this for every
>sprintf() is generally unheard of so not only would most programmers
>have missed your message, but even those who have are likely to
>forget a year down the road.

Very true. But then we have to tell people to use our UT_sprintf() call. The
overhead of calling setlocale() around every sprintf might be a bit much
though, and certainly is not correct. Consider the following:

We want to store 8,500 as 8.500 in our file format. Makes lots of sense to
have a standard encoding. We want that 8.500 to show up as 8,500 in say the
page-setup dialog for European users, because people will expect to see
8,500 not 8.500

However, I'm all for creating a UT_snprintf which gets implemented in
platform-specific classes (and in an extreme case where the platform has no
equivalent, might ignore the length argument until someone codes a
work-around). Perhaps I'll do this tonight.

Dom
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com



This archive was generated by hypermail 2b25 : Tue Apr 17 2001 - 10:10:03 CDT