[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#246398: locales: LC_CTYPE defaults to non-installed en_US.UTF8



* Branden Robinson [2004-05-21 00:45:19-0500]
> On Tue, May 04, 2004 at 11:50:07AM -0700, Blars Blarson wrote:
[...]
> > I tracked down what is setting LC_CTYPE: /usr/X11R6/bin/uxterm
> > Sorry I didn't think to check outside of X before.
> > 
> > There is even a comment about possibly not having a UTF8 enviornment
> > available.  On Debian, it is possible to check /etc/locale.gen.
> 
> That's not the right answer; I'm pretty sure the (GNU) C library
> supports function calls to inquire as to whether a given locale is
> supported.
> 
> If some of those function calls are available in a simple shell utility,
> I'd be happy to patch the uxterm shell script accordingly.  I might even
> be able to write it portably enough that it will be accepted upstream by
> Mr. Dickey.

There is the validlocale(8) utility in the base-config package and it is 
currently used at the start of the second stage d-i installation to 
validate the locale given (which comes from the debian-installer/locale 
registery).  Being a perl script, it uses the following standart call to 
determine whether the locale exists:

	my $loc = setlocale(LC_ALL, $LANG);
	if ( ! $loc) {
	    print STDERR "locale '$LANG' not available\n";
	    [...]

I think it we could write a C version of validlocale, because it has a 
fairly simple and well-defined interface, (and is already present in a 
_base_ package.)

Regards,

-- 
roktas

Attachment: signature.asc
Description: Digital signature


Reply to: