Re: setlocale

Subject: Re: setlocale
From: Thomas Fletcher (
Date: Tue Apr 17 2001 - 05:01:10 CDT

On 17 Apr 2001, Jesper Skov wrote:

> >>>>> "Dom" == Dom Lachowicz <> writes:
> Dom> Hi, I'd just like to remind everyone about an important part of
> Dom> localization - setlocale(). I've been chasing a few bugs in the
> Dom> tree caused by people not using setlocale().
> Dom> When should you use it? At least before and after every sprintf()
> Dom> that has a numeric value. We've got to make sure that these
> Dom> formatted numbers work right (our number parsing routines don't
> Dom> know what to do with 8,500in and they shouldn't have to - 8.500in
> Dom> is the standard we're sticking to).
> This should be documented somewhere! In the coding standard even, I
> think. A developer starting tomorrow will have missed your message.

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.


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