From: rringler@... Date: 2016-11-29T03:42:37+00:00 Subject: [ruby-core:78408] [Ruby trunk Feature#12786] String#casecmp? Issue #12786 has been updated by Ryan Ringler. Thank you for incorporating this! I see the changeset implements the new method by calling `String#downcase` on both strings and compares the results for equality. While this does allow unicode support in advance of `String#casecmp`, it sacrifices the performance of character-by-character comparison that `#casecmp` provides. It's also going to lead to some inconsistent behavior: ``` '������'.casecmp('������').zero? # false '������'.casecmp?('������') # true ``` I hope this was considered, and perhaps when `String#casecmp` provides better support for unicode we can update `#casecmp?` to use it. ---------------------------------------- Feature #12786: String#casecmp? https://bugs.ruby-lang.org/issues/12786#change-61781 * Author: Ryan Ringler * Status: Closed * Priority: Normal * Assignee: Martin D��rst ---------------------------------------- Description I would find String#casecmp? convenience method handy. I don't believe I've ever called String#casecmp without chaining #zero? to the result. ```ruby 'abc'.casecmp?('ABC') #=> true 'abc'.casecmp?('DEF') #=> false ``` ---Files-------------------------------- string_casecmp_.patch (4.97 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: