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=-4.1 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, 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 28E551F453 for ; Wed, 1 May 2019 22:27:47 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id F012F120928; Thu, 2 May 2019 07:27:41 +0900 (JST) Received: from o1678916x28.outbound-mail.sendgrid.net (o1678916x28.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id B6A87120928 for ; Thu, 2 May 2019 07:27:39 +0900 (JST) Received: by filter0079p3mdw1.sendgrid.net with SMTP id filter0079p3mdw1-31187-5CCA1D5B-53 2019-05-01 22:27:39.944223817 +0000 UTC m=+524835.745124241 Received: from herokuapp.com (unknown [54.159.201.37]) by ismtpd0061p1mdw1.sendgrid.net (SG) with ESMTP id Q1DutI7US8esFlfPNiQ80g for ; Wed, 01 May 2019 22:27:39.978 +0000 (UTC) Date: Wed, 01 May 2019 22:27:40 +0000 (UTC) From: jonathan@hefner.pro Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 68003 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15816 X-Redmine-Issue-Author: jonathanhefner X-Redmine-Sender: jonathanhefner 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?y87fQmSTkDB0MB8oF=2FSr+wCExKhWErwiIVXChRtBifuWFut4EsWYv9vktfVrOq?= =?us-ascii?Q?ZDpQa02yI2HcxYu3TqJq72P1wIjRkLpKs5q796q?= =?us-ascii?Q?6WPmjNC9IVyAB6697uLtg1r21n=2FfOQIM9JjwOUO?= =?us-ascii?Q?Nd8k0qYzU5ZyrC07Y7vHHT4zPb4eEqhSDocE=2F8W?= =?us-ascii?Q?2QYhm1cdVyDynJ4PhlhmSd6w+nWCDas4k9Q=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 92520 Subject: [ruby-core:92520] [Ruby trunk 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 reported by jonathanhefner (Jonathan Hefner). ---------------------------------------- Bug #15816: String#casecmp compares uppercase characters instead of lowercase https://bugs.ruby-lang.org/issues/15816 * Author: jonathanhefner (Jonathan Hefner) * Status: Open * 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. -- https://bugs.ruby-lang.org/