From owner-freebsd-bugs@FreeBSD.ORG Wed Dec 30 17:10:02 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E65F10656A5 for ; Wed, 30 Dec 2009 17:10:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 7C0128FC1D for ; Wed, 30 Dec 2009 17:10:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id nBUHA2Ao031035 for ; Wed, 30 Dec 2009 17:10:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id nBUHA24o031034; Wed, 30 Dec 2009 17:10:02 GMT (envelope-from gnats) Resent-Date: Wed, 30 Dec 2009 17:10:02 GMT Resent-Message-Id: <200912301710.nBUHA24o031034@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Stefan Krah Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C41D3106568F for ; 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 ; 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 ; 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 To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/142173: localeconv: two-byte ascii thousands_sep X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2009 17:10:02 -0000 >Number: 142173 >Category: misc >Synopsis: localeconv: 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: >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 >Fix: Patch attached with submission follows: #include #include #include #include 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; } >Release-Note: >Audit-Trail: >Unformatted: