Code Comments
Programming Forum and web based access to our favorite programming groups.In article <419c872c@news.012.net.il>,
Aharon Robbins <arnold@skeeve.com> wrote:
>In article <ykPmd.6493$3U4.143215@news02.tsnz.net>,
>Don Stokes <don@daedalus.co.not-this-bit.nz> wrote:
>
>I still think it's best done with a shell wrapper. You're the only
>one to request it so far, in the almost 4 years since 3.1.0 and
>the i18n features were released.
I have developed an extension (shared lib) to GAWK called "call_any", that
allows you to call "any" (for some definition of any) C library function
from AWK. So, call_any is more useful than a dedicated way to call
setlocale().
Here is an example, that speaks to this thread topic:
% gawk 'BEGIN {extension(ENVIRON["HOME"]"/lib/call_any.so","dlload")
print "Locale is now:",call_any("sis","setlocale",6,"pt_BR")
s=" "
print call_any("isisd","strfmon",s,10,"%n",45.156);print s}'
Locale is now: pt_BR
3
£ 45
%
For fun, you can try this with other locales - en_US, en_GB, etc.
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.