From owner-freebsd-stable@FreeBSD.ORG Mon Feb 6 16:59:00 2006 Return-Path: X-Original-To: freebsd-stable@FreeBSD.ORG Delivered-To: freebsd-stable@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 28ECF16A420 for ; Mon, 6 Feb 2006 16:59:00 +0000 (GMT) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7656D43D48 for ; Mon, 6 Feb 2006 16:58:59 +0000 (GMT) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (ezklyv@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id k16GwqVZ068151 for ; Mon, 6 Feb 2006 17:58:58 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id k16GwqLr068150; Mon, 6 Feb 2006 17:58:52 +0100 (CET) (envelope-from olli) Date: Mon, 6 Feb 2006 17:58:52 +0100 (CET) Message-Id: <200602061658.k16GwqLr068150@lurza.secnetix.de> From: Oliver Fromme To: freebsd-stable@FreeBSD.ORG In-Reply-To: <43E3B356.7030203@nurfuerspam.de> X-Newsgroups: list.freebsd-stable User-Agent: tin/1.8.0-20051224 ("Ronay") (UNIX) (FreeBSD/4.11-STABLE (i386)) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Mon, 06 Feb 2006 17:58:58 +0100 (CET) Cc: Subject: Re: tr(1) buggy with de_DE.ISO8859-1(5) locale? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-stable@FreeBSD.ORG List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2006 16:59:00 -0000 Martin wrote: > There is a quite nasty bug in tr(1) when using > de_DE.ISO8859-1(5) locale. It's not a bug. It's perfectly POSIX-compatible. > unsetenv LC_ALL > setenv LANG de_DE.ISO8859-1 > echo v | tr a-z A-Z > > I'm getting "W" as result. Shouldn't it be "V"? No, it should be "W". To convert lower case to upper case, use the command "tr '[:lower:]' '[:upper:]'" (or enumerate all letters explicitely, like "tr abcdef ABCDEF"). Skripts that use things like "tr a-z A-Z" are broken and need to be fixed. By the way: Do not set LANG or LC_ALL, expecially for the root user, and especially when compiling things. Not only will tr behave in unexpected ways when used like above, but also other things might break. For example, German month names appear in "ls -l", which will break scripts that try to parse them. Some tools use decimal commas instead of decimal points, which can lead to further confusion, etc. Yes, scripts which try to do that are broken, but they do exist. If you only need support for German umlauts, then only set LC_CTYPE. That shouldn't break anything. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. "I invented Ctrl-Alt-Delete, but Bill Gates made it famous." -- David Bradley, original IBM PC design team