instance method
charset=
Ruby on Rails 8.0.4
Since v5.2.8.1Signature
charset=(charset)
Sets the HTTP character set. In case of nil parameter it sets the charset to default_charset.
response.charset = 'utf-16' # => 'utf-16' response.charset = nil # => 'utf-8'
Parameters
-
charsetreq
Source
# File actionpack/lib/action_dispatch/http/response.rb, line 315
def charset=(charset)
content_type = parsed_content_type_header.mime_type
if false == charset
set_content_type content_type, nil
else
set_content_type content_type, charset || self.class.default_charset
end
end
Defined in actionpack/lib/action_dispatch/http/response.rb line 315
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionDispatch::Response