Skip to content

Instantly share code, notes, and snippets.

@abstractart
Created November 6, 2018 09:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abstractart/15fe73166a67ebf1880c2e06f542a1ab to your computer and use it in GitHub Desktop.
Save abstractart/15fe73166a67ebf1880c2e06f542a1ab to your computer and use it in GitHub Desktop.
Downcase non-ASCII characters in Ruby < 2.4
# gem install activesupport
require 'active_support/core_ext/string/multibyte'
"Женя".mb_chars.downcase.to_s # => "женя"
"Женя".mb_chars.upcase.to_s # => "ЖЕНЯ"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment