Rails has support for working with Unicode characters using the ActiveSupport multibyte chars functionality.
For example:
Unicode
and Chars
in ActiveSupport had their own implementation for
methods like downcase
, upcase
, swapcase
, normalize
, etc.
Rails 6 deprecated below methods in ActiveSupport in favor of using String methods directly.
-
Unicode#downcase/upcase/swapcase in favor of
String#downcase/upcase/swapcase
. -
Unicode#normalize, Chars#normalize in favor of
String#unicode_normalize
. -
Chars.consumes? in favor of
String#is_utf8?
.
These String methods are available from Ruby 2.3+ onwards and hence they are delegated to Ruby Strings.
Before Rails 6
In Rails 6
Executing the above methods in Rails 6 will issue DEPRECATION
warning
as seen below: