class ActiveSupport::Multibyte::Chars
def normalize(form = nil)
:c, :kc, :d, or :kd. Default is
* form - The form you want to normalize in. Should be one of the following:
and validations.
considered the best normalization form for passing strings to databases
Returns the KC normalization of the string by default. NFKC is
def normalize(form = nil) form ||= Unicode.default_normalization_form # See https://www.unicode.org/reports/tr15, Table 1 if alias_form = Unicode::NORMALIZATION_FORM_ALIASES[form] ActiveSupport::Deprecation.warn(<<-MSG.squish) ActiveSupport::Multibyte::Chars#normalize is deprecated and will be removed from Rails 6.1. Use #unicode_normalize(:#{alias_form}) instead. MSG send(:unicode_normalize, alias_form) else ActiveSupport::Deprecation.warn(<<-MSG.squish) ActiveSupport::Multibyte::Chars#normalize is deprecated and will be removed from Rails 6.1. Use #unicode_normalize instead. MSG raise ArgumentError, "#{form} is not a valid normalization variant", caller end end