On the topic of case and unicode, it's also important to remember that, somewhat surprisingly, the number of characters can change when a change in case occurs:<p><pre><code> $ irb
>> puts RUBY_VERSION
2.6.5
>> "ß".chars.size
=> 1
>> "ß".upcase.chars.size
=> 2</code></pre>