MTVS
MTVS

Reputation: 2096

PHP mb_internal_encoding()

In PHP docs for mb_internal_encoding() it says:

encoding is the character encoding name used for the HTTP input character encoding conversion, HTTP output character encoding conversion, and the default character encoding for string functions defined by the mbstring module.

My assumption has been that the PHP gets Binary Data operates on it ouptuts Binary Data too, that interpreted by the user agents by the specified charset for the content.

What does it mean by HTTP input/output char conversions? How does PHP know the HTTP input encoding to convert it to another encoding?

Upvotes: 1

Views: 987

Answers (1)

Esailija
Esailija

Reputation: 140230

By default, you are correct. But the mb_string extension can be configured to hook into http input and http output of php and perform automatic conversions when needed.

By default, the config values are:

mbstring.encoding_translation   "0"
mbstring.http_input = pass
mbstring.http_output = pass

See docs for more info.

Upvotes: 1

Related Questions