From owner-freebsd-questions Thu Nov 30 0:51:12 2000 Delivered-To: freebsd-questions@freebsd.org Received: from boco.fee.vutbr.cz (boco.fee.vutbr.cz [147.229.9.11]) by hub.freebsd.org (Postfix) with ESMTP id 70DDE37B400 for ; Thu, 30 Nov 2000 00:51:06 -0800 (PST) Received: from kazi.dcse.fee.vutbr.cz (kazi.dcse.fee.vutbr.cz [147.229.8.12]) by boco.fee.vutbr.cz (8.11.1/8.11.1) with ESMTP id eAU8oxe06242 (using TLSv1/SSLv3 with cipher EDH-RSA-DES-CBC3-SHA (168 bits) verified OK); Thu, 30 Nov 2000 09:50:59 +0100 (CET) Received: (from cejkar@localhost) by kazi.dcse.fee.vutbr.cz (8.11.0/8.11.0) id eAU8omu51090; Thu, 30 Nov 2000 09:50:48 +0100 (CET) Date: Thu, 30 Nov 2000 09:50:48 +0100 From: Cejka Rudolf To: Mikhail Teterin Cc: questions@FreeBSD.ORG Subject: Re: setting locale Message-ID: <20001130095048.A50821@dcse.fee.vutbr.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from mi@privatelabs.com on Wed, Nov 29, 2000 at 05:02:30PM -0500 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Mikhail Teterin wrote (2000/11/29): > How do I make force my C-program use the right locale? I could do > something like: > setlocale(LC_ALL, getenv("LANG")) > but is not that what specifying NULL is supposed to do? No. There is a difference between NULL and "" - man setlocale: Only three locales are defined by default, the empty string "" which de- notes the native environment, and the "C" and "POSIX" locales, which de- note the C language environment. A locale argument of NULL causes setlocale() to return the current locale. ... which for "" means that (man setlocale on Solaris) ... A value of "" for locale specifies that the locale should be taken from environment variables. -- Rudolf Cejka (cejkar@dcse.fee.vutbr.cz; http://www.fee.vutbr.cz/~cejkar) Brno University of Technology, Faculty of El. Engineering and Comp. Science Bozetechova 2, 612 66 Brno, Czech Republic To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message