From owner-freebsd-questions Tue Oct 13 05:12:27 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id FAA15872 for freebsd-questions-outgoing; Tue, 13 Oct 1998 05:12:27 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from iclub.nsu.ru (iclub.nsu.ru [193.124.222.66]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id FAA15859 for ; Tue, 13 Oct 1998 05:12:22 -0700 (PDT) (envelope-from fjoe@iclub.nsu.ru) Received: from localhost (fjoe@localhost) by iclub.nsu.ru (8.8.8/8.8.5) with ESMTP id TAA23890 for ; Tue, 13 Oct 1998 19:16:53 +0700 (NSS) Date: Tue, 13 Oct 1998 19:16:53 +0700 (NSS) From: Max Khon To: freebsd-questions@FreeBSD.ORG Subject: _BSD_CT_RUNE_T_ Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=KOI8-R Content-Transfer-Encoding: 8BIT Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG hi, there! Can someone explain me why _BSD_CT_RUNE_T_ is typedefed as int? Because of this i always need to redefine toupper/tolower with something like this: #define UPPER(c) (toupper((unsigned char) c)) The following code works fine under Linux and does not work under FreeBSD ($LANG == ru_RU.KOI8-R): ... const char c[] = "Â"; /* russian 'b' */ setlocale(LC_ALL, ""); printf("%c\n", toupper(c[0])); /* does not print russian 'B' */ ... if 'c' is 'const unsigned char[]' or toupper(c[0]) is replaced with toupper((unsigned char) c[0]) everything works fine /fjoe PS Yes, i saw toupper and __toupper code To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message