From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 58CA71F4BD for ; Wed, 2 Oct 2019 15:03:45 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id DE70A120A71; Thu, 3 Oct 2019 00:03:36 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id 2C04B120A57 for ; Thu, 3 Oct 2019 00:03:33 +0900 (JST) Received: by filter0129p3las1.sendgrid.net with SMTP id filter0129p3las1-10417-5D94BBE4-36 2019-10-02 15:01:56.209817952 +0000 UTC m=+72978.939360124 Received: from herokuapp.com (unknown [18.206.91.11]) by ismtpd0057p1iad1.sendgrid.net (SG) with ESMTP id SxWwjPQSQuqJJG-CjVJoPQ for ; Wed, 02 Oct 2019 15:01:56.004 +0000 (UTC) Date: Wed, 02 Oct 2019 15:01:56 +0000 (UTC) From: merch-redmine@jeremyevans.net Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 70744 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15816 X-Redmine-Issue-Author: jonathanhefner X-Redmine-Sender: jeremyevans0 X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?RVE3t853K5scBhbmJHUzZTFFeVC=2FZSUmHZ0Dc+26wcEi2CTgsF1oz0wTSSxGGN?= =?us-ascii?Q?BImsfBtkkpUn0guQX+vVzaAbkb3o0jkXDpRvLBR?= =?us-ascii?Q?qWaox1qSttTJ9KGfbIbt2kmKENDQQuRkmWBYuIS?= =?us-ascii?Q?oaH+Ls7GtkjZ42O=2F2zbg+hyYYo3jPE1rfifqFGA?= =?us-ascii?Q?BRZn8JLzH7x7uvRNTpjVlQUki73mZA0ooMw=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 95189 Subject: [ruby-core:95189] [Ruby master Bug#15816] String#casecmp compares uppercase characters instead of lowercase X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #15816 has been updated by jeremyevans0 (Jeremy Evans). Status changed from Open to Closed Fixed in commit:082424ef58116db9663a754157d6c441d60fd101. ---------------------------------------- Bug #15816: String#casecmp compares uppercase characters instead of lowercase https://bugs.ruby-lang.org/issues/15816#change-81825 * Author: jonathanhefner (Jonathan Hefner) * Status: Closed * Priority: Normal * Assignee: * Target version: * ruby -v: * Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN ---------------------------------------- The current implementation of `String#casecmp` converts characters to uppercase before comparing them. However, all references I've found for `strcasecmp` (the C function on which `String#casecmp` is based) indicate characters should be converted to lowercase before being compared. For example, [this man page](http://manpages.ubuntu.com/manpages/eoan/man3/strcasecmp.3.html) says: > The POSIX.1-2008 standard says ... shall behave as if the strings had been converted to lowercase and then a byte comparison performed. The difference in behavior is apparent when comparing / sorting strings containing `[`, `\`, `]`, `^`, `_`, or `` ` `` (the characters that occur between `Z` and `a`). Converting to lowercase sorts these punctuation characters before `A`-`z` along with most of the other punctuation in ASCII, but converting to uppercase sorts these characters after `A`-`z` instead. ---Files-------------------------------- casecmp-lowercase.patch (1.3 KB) -- https://bugs.ruby-lang.org/