From nobody@FreeBSD.org  Wed Dec 30 17:03:52 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C41D3106568F
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 30 Dec 2009 17:03:52 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id B40558FC1D
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 30 Dec 2009 17:03:52 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id nBUH3qWR044936
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 30 Dec 2009 17:03:52 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id nBUH3qes044935;
	Wed, 30 Dec 2009 17:03:52 GMT
	(envelope-from nobody)
Message-Id: <200912301703.nBUH3qes044935@www.freebsd.org>
Date: Wed, 30 Dec 2009 17:03:52 GMT
From: Stefan Krah <stefan-usenet@bytereef.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: localeconv: two-byte ascii thousands_sep
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         142173
>Category:       kern
>Synopsis:       [libc] localeconv(3): two-byte ascii thousands_sep
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Dec 30 17:10:02 UTC 2009
>Closed-Date:    
>Last-Modified:  Thu Dec 31 06:32:16 UTC 2009
>Originator:     Stefan Krah
>Release:        8.0-RELEASE-i386
>Organization:
>Environment:
>Description:

The following locales have a two-byte ascii thousands separator. In all cases,
the real separator is followed by an ascii whitespace character. In the
attached test program, the separator is enclosed in XXX:


it_CH.ISO8859-1: XXX. XXX
it_CH.ISO8859-15: XXX. XXX
it_CH.UTF-8: XXX. XXX
it_IT.ISO8859-1: XXX. XXX
it_IT.ISO8859-15: XXX. XXX
it_IT.UTF-8: XXX. XXX
sl_SI.ISO8859-2: XXX  XXX
sl_SI.UTF-8: XXX  XXX



>How-To-Repeat:

Compile the test program. Run:

locale -a | ./printsep

Test program:

Test program:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <locale.h>


int
main(void)
{
	char loc[100];
	size_t n;

	while (fgets(loc, 100, stdin) != NULL) {
		n = strlen(loc);
		if (n > 1) {
			loc[n-1] = '\0';
			setlocale(LC_ALL, loc);
			n = mbstowcs(NULL, localeconv()->thousands_sep, 0);
			if (n > 1) {
				printf("%s: XXX%sXXX\n", loc, localeconv()->thousands_sep);
			}
		}
	}

	return 0;
}

>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
