www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2025/02/17/07:05:34

DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 51HC5YTp2910898
Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com
Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com
DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 51HC5YTp2910898
Authentication-Results: delorie.com;
dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=g1qMjWzm
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D95163858D33
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1739793933;
bh=iBlhN1Ueu7XVZvPVI6XjIpejdwuhsTB8FTxKPNK7qa0=;
h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=g1qMjWzmtDP2bjtdPjyzmqqQ9UmtCfl2JvxendgfYhBIMRE/wg9MlCFTIPx9+9Dxn
JtbfdFh/O8c3fidotR5CkGXRXQJeNG0PIA9f2PcmtDGoOIGCG8Bo6yAU16KSs+Xz9q
y/GEvVTx0281OuhsDG8UkjJX6Q3C9thu61gecx2Y=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D2AF73858D1E
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D2AF73858D1E
ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1739793901; cv=pass;
b=qlpFR35Yc5749j7piwCdk3cXAcXsC4Z7lyvXkvGUQKafJmVn0LCKn7o5ltVpVdNUsVVWuxHcY9muwMFebMGl4n9IeuOpR10ZrdIEGOHAf8Ikf15gNfgI8dCEV2aPqGdXe5ZGIgVdrEnIkRNMm8sAT0vEm4mr1bpe0AflY87ose8=
ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key;
t=1739793901; c=relaxed/simple;
bh=lepQszUD68reCru+FqT+6yD5fLGYKJ9vJR21XhxUkNw=;
h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID:
MIME-Version;
b=Q3BrQ3Emwsx7Qa9y0fSPuH1aetsA/zQjHx+Sk1uN9aeQGAkaXLflkNPGXz0k++vZKSjhMIYqtg0s68GErLDmNoQsRTWQ6ggx/Yvt3vJCDsJovl6eByibcya/xdk99m9zYO19uaUsFs6Jz45zdwchd7APJsw+Hw914JhSXdMO64c=
ARC-Authentication-Results: i=2; server2.sourceware.org
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D2AF73858D1E
ARC-Seal: i=1; a=rsa-sha256; t=1739793899; cv=none;
d=strato.com; s=strato-dkim-0002;
b=jdpPPL/qT3VK8CKmFQU7hmz8VaHKtqXv51qq3QlDmoxGf0PJ7Zlq3SVXRUKuWSc5Rw
zBMyQqi6XRwTIhq98IOa37cq/rASi8BCJc85fBDfbNlZ19LmPmJMaOEa3fwo3iSu5r+C
eGWzlSApgs06dOrd1T2rFi4dlg5REiLcGH6jU8kc1JVgmFWZFl5yrzmr442adQ0jkR7c
iJ8Bkzrasl2/R5iZn+0LpkpD24zbXe047uBybi0qZYFP3u1cElThXHVQiIxX/HsvsxE4
At6blOLt65PwZGMr32j+I/m944MyzUdV1ned9IdxOplASuIETNY215f589M0rpvfh993
2q4Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1739793899;
s=strato-dkim-0002; d=strato.com;
h=References:In-Reply-To:Message-ID:Date:Subject:To:From:Cc:Date:From:
Subject:Sender;
bh=3DojvsSG3j4eZH/abqjmBibWn1ZBdu1ZvJ575mL2/3Q=;
b=j6aKm9pM1veQtUiVUcD0AcHrHUUBsJsznYCkhLcega3Zbn6Be3gIyzO17OHGJ1JZjQ
xQahqihkPlYPZr5JMdugt25F/mQ9+SMWssNs9o55hlLoXbYHwqSBEmemJLshWJOllz9y
sl975vHg978ZZXMEZfzUTAHLtft2SzJv72zyrmSn1hy9n8oE7oP9HI6JJu9UV3oSO0NN
Dl4Xbbv5SwcvhgmJb5VSqwI1xYVUv0U3J3WhfGr1xCKJtIt2+syKPZekUMfK2sZMZ6eU
HKIkL6Qd4ODY2t6gET9dFnA5znrERnEaYvnIeEzwbpIIoiVKiucUsj5IhtJYt4WDNjfF
NmQA==
ARC-Authentication-Results: i=1; strato.com;
arc=none;
dkim=none
X-RZG-CLASS-ID: mo01
X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlLnY4jECd2hdUURIbZgL8PX2QiTuZ3cdB8X/nqmmeHTyqSHKY0MaVUIjzuYeaGlfV"
To: cygwin AT cygwin DOT com
Subject: Re: bug in strcasecmp and strncasecmp
Date: Mon, 17 Feb 2025 13:04:59 +0100
Message-ID: <25218143.kmuVQn2iE0@nimes>
Organization: GNU
In-Reply-To: <Z7MiyoCV7hXKfteV@calimero.vinschen.de>
References: <2031387 DOT 2IRrRt1zHL AT nimes> <6261974 DOT 2l3rmUXbR5 AT nimes>
<Z7MiyoCV7hXKfteV AT calimero DOT vinschen DOT de>
MIME-Version: 1.0
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Bruno Haible via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Bruno Haible <bruno AT clisp DOT org>
Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com>

Corinna Vinschen wrote:
> > They can't work on multibyte strings. This is evident from the fact that
> > strncasecmp gets one integer as argument, not two integers.
> 
> Good point.
> 
> With standard functions, one really should convert MB string to wide
> char and call wcscasecmp, etc.

Nope, wide characters are the wrong approach to the problem [1].

Nowadays, ISO C 23 has standardized on char32_t as the portable Unicode
character type. [2] They have left the corresponding functions "as an
exercise to the reader", though. Gnulib and GNU libunistring fill this gap.
See the columns "multibyte strings" and "32-bit wide character strings" in [3].

Bruno

[1] https://www.gnu.org/software/gnulib/manual/html_node/The-wchar_005ft-type.html
[2] https://www.gnu.org/software/gnulib/manual/html_node/The-char32_005ft-type.html
[3] https://www.gnu.org/software/gnulib/manual/html_node/Comparison-of-string-APIs.html




-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019