instance method preserve_encoding

Ruby on Rails 2.3.18

Since v2.3.18 Last seen in v2.3.18

Signature

preserve_encoding(string)

No documentation comment.

Parameters

string req
Source
# File activesupport/lib/active_support/vendor/i18n-0.4.1/i18n/backend/base.rb, line 190
        def preserve_encoding(string)
          if string.respond_to?(:encoding)
            encoding = string.encoding
            result = yield
            result.force_encoding(encoding) if result.respond_to?(:force_encoding)
            result
          else
            yield
          end
        end

Defined in activesupport/lib/active_support/vendor/i18n-0.4.1/i18n/backend/base.rb line 190 · View on GitHub · Improve this page · Find usages on GitHub

Defined in I18n::Backend::Base

Type at least 2 characters to search.

↑↓ navigate · open · esc close