Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Oct 1998 19:16:53 +0700 (NSS)
From:      Max Khon <fjoe@iclub.nsu.ru>
To:        freebsd-questions@FreeBSD.ORG
Subject:   _BSD_CT_RUNE_T_
Message-ID:  <Pine.BSF.3.96.981013185854.23430A-100000@iclub.nsu.ru>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.981013185854.23430A-100000>