method

normalize

rails latest stable - Class: ActiveSupport::Multibyte::Handlers::UTF8HandlerProc

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v2.1.0) is shown here.

normalize(str, form=ActiveSupport::Multibyte::DEFAULT_NORMALIZATION_FORM)
public

No documentation available.

# File activesupport/lib/active_support/multibyte/handlers/utf8_handler_proc.rb, line 6
    def normalize(str, form=ActiveSupport::Multibyte::DEFAULT_NORMALIZATION_FORM) #:nodoc:
      codepoints = str.unpack('U*')
      case form
        when :d
          utf8map(str, :stable)
        when :c
          utf8map(str, :stable, :compose)
        when :kd
          utf8map(str, :stable, :compat)
        when :kc
          utf8map(str, :stable, :compose, :compat)
        else
          raise ArgumentError, "#{form} is not a valid normalization variant", caller
      end
    end