Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 08 Feb 2000 22:56:52 -0700
From:      Wes Peters <wes@softweyr.com>
To:        Jason Simms <jlsimms@hotmail.com>
Cc:        hackers@freebsd.org
Subject:   Re: Localization and locale()?
Message-ID:  <38A101A4.7500CAD1@softweyr.com>
References:  <20000208213905.96551.qmail@hotmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?38A101A4.7500CAD1>