Skip to content

Conversation

kirs
Copy link
Contributor

@kirs kirs commented Oct 20, 2014

Rails returns "Content-Type: text/html; charset=utf-8"
and for Lotus it’s just "Content-Type: text/html"
it may be a problem with some languages like Russian

@kirs
Copy link
Contributor Author

kirs commented Oct 20, 2014

@jodosha please tell if the implementation is OK and I'll add the docs then.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.75%) when pulling 8cc891b on kirs:charset-setting into 9698719 on lotus:master.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be:

def charset
  @charset || default_charset || DEFAULT_CHARSET
end

def default_charset
  configuration.default_charset
end

So the priority will be:

  1. Local override (self.charset=)
  2. Framework configuration (Lotus::Controller.configure { default_charset 'x' })
  3. Default charset (DEFAULT_CHARSET).

@jodosha
Copy link
Member

jodosha commented Oct 20, 2014

@kirs Thanks for this PR.

There aren't tests for the following scenarios:

Local override

def call(params)
  self.charset = 'latin1'
end

Configuration

Lotus::Controller.configure do
  default_charset 'ISO-8859-1'
end

@jodosha jodosha self-assigned this Oct 20, 2014
Rails returns "Content-Type: text/html; charset=utf-8"
and for Lotus it’s just "Content-Type: text/html"
it may be a problem with some languages like Russian
@kirs
Copy link
Contributor Author

kirs commented Oct 20, 2014

@jodosha done!

@jodosha jodosha merged commit a02aaf9 into hanami:master Oct 21, 2014
jodosha added a commit that referenced this pull request Oct 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants