Subject: Re: userlevel tools and setlocale(3)
To: None <>
From: Aleksey Cheusov <>
List: tech-userlevel
Date: 04/29/2006 00:24:33
> On Fri, Apr 28, 2006 at 05:56:06PM +0300, Aleksey Cheusov wrote:
 >> > On Thu, Apr 27, 2006 at 09:53:56PM +0300, Aleksey Cheusov wrote:
 >>  >> What do you think about the following patch for nawk?
 >>  >> With this patch applied, awk will exit with error
 >>  >> if LANG or LC_ variable are set to incorrect value,
 >> > Incorrect locale settings are softerrors, since it is entire
 >> > possible that a single part of a locale is not defined. setlocale()
 >> > is well-behaving in that regard, it falls back to "C", as if nothing
 >> > had happened.
 >> With this "softerror" scripts that rely on locale
 >> work _completely_ incorrect with no chance of signaling
 >> user about errors.

> locale(1)?
Ok, I have a chance. Really, I know about locale(1) wery well.  But I
assume that embedding locale(1) to each locale-specific script is not
the best way to really fix a problem.  BTW, locale is not a standard
utility, and AFAIK FreeBSD-4 (it is still widely used) was shipped
with no locale(1) utility at all.  So, My script cannot be really
portable. I'm not expert in OpenBSD and in BSD in general,
but I cannot find locale(1) in OpenBSD-8 too.

Best regards, Aleksey Cheusov.