From owner-freebsd-stable@FreeBSD.ORG Sat Aug 12 16:58:40 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 0ACE716A4DA; Sat, 12 Aug 2006 16:58:40 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from soapbox.mail.yandex.net (soapbox.mail.yandex.net [213.180.223.94]) by mx1.FreeBSD.org (Postfix) with ESMTP id A229443D46; Sat, 12 Aug 2006 16:58:39 +0000 (GMT) (envelope-from bu7cher@yandex.ru) Received: from YAMAIL (soapbox.yandex.ru) by mail.yandex.ru id ; Sat, 12 Aug 2006 20:58:28 +0400 Received: from [82.211.152.12] ([82.211.152.12]) by mail.yandex.ru with HTTP; Sat, 12 Aug 2006 20:58:28 +0400 (MSD) Date: Sat, 12 Aug 2006 20:58:28 +0400 (MSD) From: "Andrey V. Elsukov" Sender: bu7cher@yandex.ru Message-Id: <44DE08B4.000003.11633@soapbox.yandex.ru> MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] Errors-To: bu7cher@yandex.ru To: kostikbel@gmail.com In-Reply-To: <20060812155431.GG25753@deviant.kiev.zoral.com.ua> References: <44DDDCC5.000001.21350@pantene.yandex.ru> <20060812155431.GG25753@deviant.kiev.zoral.com.ua> X-Source-Ip: 82.211.152.12 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Cc: maxim@freebsd.org, bu7cher@yandex.ru, freebsd-stable@freebsd.org Subject: Re: setlocale howto X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: bu7cher@yandex.ru List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Aug 2006 16:58:40 -0000 >On Sat, Aug 12, 2006 at 05:51:01PM +0400, Andrey V. Elsukov wrote: >> for(i = 0; i < sizeof(buf); i++) >> buf[i] = (char)toupper(buf[i]); > > buf[i] = (char)toupper((unsigned char)buf[i]); >Standard integer promotion promotes KOI8-R char codes like 0xd4 into 0xffffffd4. >Since such codepoints are not defined for KOI8-R, toupper returns them >unchaged, as specified in documentation. Thanks, this works! But why this example works on Linux without type conversions? -- WBR, Andrey V. Elsukov