From owner-freebsd-hackers Wed Feb 9 1: 6:48 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from ind.alcatel.com (postal.xylan.com [208.8.0.248]) by builder.freebsd.org (Postfix) with ESMTP id D26B04335 for ; Tue, 8 Feb 2000 21:51:34 -0800 (PST) Received: from mailhub.xylan.com (mailhub [198.206.181.70]) by ind.alcatel.com (8.9.3+Sun/8.9.1 (ind.alcatel.com 3.0 [OUT])) with SMTP id VAA29021; Tue, 8 Feb 2000 21:50:57 -0800 (PST) X-Origination-Site: Received: from omni.xylan.com by mailhub.xylan.com (SMI-8.6/SMI-SVR4 (mailhub 2.1 [HUB])) id VAA25777; Tue, 8 Feb 2000 21:50:57 -0800 Received: from softweyr.com (dyn4.utah.xylan.com [198.206.184.240]) by omni.xylan.com (8.9.3+Sun/8.9.1 (Xylan engr [SPOOL])) with ESMTP id VAA03685; Tue, 8 Feb 2000 21:50:56 -0800 (PST) Message-ID: <38A101A4.7500CAD1@softweyr.com> Date: Tue, 08 Feb 2000 22:56:52 -0700 From: Wes Peters Organization: Softweyr LLC X-Mailer: Mozilla 4.7 [en] (X11; U; FreeBSD 3.3-RELEASE i386) X-Accept-Language: en MIME-Version: 1.0 To: Jason Simms Cc: hackers@freebsd.org Subject: Re: Localization and locale()? References: <20000208213905.96551.qmail@hotmail.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Jason Simms wrote: > > Hello, > > I am currently writing several programs that, for one reason or another, > need to be localized in various sections. On Solaris, I can see what > choices I have by running 'locale -a'. However, all my attempts to find a > similar function on FreeBSD 3.4 have failed. > > I would have searched the mailing list archives, but they are, of course, > currently down. Also, my search through the handbook also only showed > examples for Russian and German encoding (section 12). > > For my specific problem, I need access to the following three character > sets: > > es_ES.ISO8859-1 > pt.PT.ISO8859-1 > en_US.ISO8859-1 > > And within my program (Perl), I need to use the setlocale() function > imported from the POSIX module (actually, from the locale_h header file). > If I run this on FreeBSD, will the program die on me due to the apparent > lack of a locale function? If one is available, where can I get it from? > And finally, if these character sets are not installed on my system, what is > the best way to go about getting them on there? Any help or insight would > be appreciated, so thanks! man -k locale reports: mklocale(1) - make LC_CTYPE locale files perllocale(1) - Perl locale handling (internationalization and locali zation) setlocale(3), localeconv(3) - natural language formatting for C setrunelocale(3), setinvalidrune(3), sgetrune(3), sputrune(3) - rune support for C strxfrm(3) - transform a string under locale I18N::Collate(3) - compare 8-bit scalar data according to the current lo cale 1 *** 3 WARNING: starting from the Perl version 5.003_06 the I18N::Co llate interface for comparing 8-bit scalar data according to the current local e 1 HAS BEEN DEPRECATED 4 That is, please do not use it anymore for an y new applications and please migrate the old applications away from it becaus e its functionality was integrated into the Perl core language in the releas e 5.003_06. 1 See the perllocale manual page for further information. 1 *** locale(3) - Perl pragma to use and avoid POSIX locales for built- in operations It seems highly likely that either setlocale(3) or locale(3) are what you're looking for. So, I guess my advice would be to RTFM. ;^) -- "Where am I, and what am I doing in this handbasket?" Wes Peters Softweyr LLC wes@softweyr.com http://softweyr.com/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message