From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA12287; Mon, 14 Jun 2004 17:58:41 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA12532; Mon, 14 Jun 2004 17:58:40 +0200 (MET DST) Received: from fw.m12.ru (49_81.otts.ru [195.162.49.81] (may be forged)) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i5EFwbEV005571; Mon, 14 Jun 2004 17:58:38 +0200 Received: from jah.m12.ru ([192.168.1.1]) by fw.m12.ru with esmtp (Exim 3.36 #1 (Debian)) id 1BZtpg-0004XG-00; Mon, 14 Jun 2004 22:57:12 +0700 Received: from codedj by jah.m12.ru with local (Exim 3.36 #1 (Debian)) id 1BZtpg-0005or-00; Mon, 14 Jun 2004 22:57:12 +0700 To: Yamagata Yoriyuki Cc: xavier.leroy@inria.fr, caml-list@inria.fr Subject: Re: [Caml-list] string_of_float -> float_of_string locale dependency bug References: <20040614115444.A14769@pauillac.inria.fr> <20040615.002347.94548124.yoriyuki@mbg.ocn.ne.jp> From: Evgeny Chukreev Date: Mon, 14 Jun 2004 22:57:12 +0700 In-Reply-To: <20040615.002347.94548124.yoriyuki@mbg.ocn.ne.jp> (Yamagata Yoriyuki's message of "Tue, 15 Jun 2004 00:23:47 +0900 (JST)") Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Miltered: at nez-perce with ID 40CDCB2D.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 locale:01 bug:01 2004:99 yamagata:01 yoriyuki:01 yoriyuki:01 api:01 locale:01 temporally:01 python's:01 float:02 float:02 string:03 string:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tue, 15 Jun 2004 00:23:47 +0900 (JST) /Yamagata/ /Yoriyuki/ wrote: XL>> The C library API for internationalization is largely broken, and as XL>> you can see there is nothing we can do to work around the fact that XL>> the current locale is a global variable for the whole program. YY> You can temporally save the current LC_NUMERIC value, change its value YY> to C, and restore the value after the conversion. What is a problem? Performance? Another approach: write own strtod function which doesn't depend on the LC_NUMERIC locale. Or take a look at Python's: _localemodule.c and locale.py. -- ... WBR, Evgeny ... ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners