zootropo
zootropo

Reputation: 2491

Symfony and ISO-8859-1

There's this app where I need the responses generated by Symfony to use ISO-8859-1 instead of UTF-8, because of backward compatibility issues.

The thing is, Symfony adds a header at Symfony\Component\HttpFoundation\Response::prepare() telling the user that the content is in whatever encoding $this->charset contains at that moment, and for me this is always UTF-8, regardless of me changing config.yml to

framework:
    charset:         ISO-8859-1
...

Isn't this the purpose of this setting? And if not, what's this setting for? How can I instruct Symfony to add an ISO-8859-1 header instead of UTF-8?

Upvotes: 1

Views: 1793

Answers (2)

Use latin 1 instead. This works for me.

Upvotes: 0

mrzard
mrzard

Reputation: 311

At least with Symfony 2.1 you have to add a getCharset method to your AppKernel, like this:

/**
 * Get the framework charset
 *
 * @return string The charset
 */
public function getCharset()
{
    return 'ISO-8859-1';
}

Upvotes: 1

Related Questions