In PHP 5.6, does mbstring.encoding_translation serve any purpose anymore?

358 Views Asked by At

In PHP 5.6 the following configuration variables have been deprecated:

mbstring.internal_encoding
mbstring.http_input
mbstring.http_output

Instead we are told that PHP 5.6 and later users should leave these empty and set default_charset instead. Now, my understand of mbstring.encoding_translation is that it turns on conversion of http POST data from mbstring.http_input to mbstring.internal_encoding

But if we use a single variable for both of these, then we get conversion of http POST data from default_charset to... default_charset? That's a no-op. So is there any purpose to mbstring.encoding_translation anymore?

1

There are 1 best solutions below

0
On

My guess is that a website usually expects data to be received in the same encoding as used for output. So if a website uses UTF-8, it expects data to be sent to it in UTF-8 as well.

So if you want your website to use another encoding, you now only have to adjust default_charset and from a PHP configuration point of view, you are done. PHP then properly sets Content-Type to let the client (browser) know.