Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The advice regarding mb_internal_encoding #867

Open
iio7 opened this issue Dec 12, 2020 · 2 comments
Open

The advice regarding mb_internal_encoding #867

iio7 opened this issue Dec 12, 2020 · 2 comments

Comments

@iio7
Copy link

iio7 commented Dec 12, 2020

The advice given is that:

You should use the mb_internal_encoding() function at the top of every PHP script you write (or at the top of your global include script), and the mb_http_output() function right after it if your script is outputting to a browser. Explicitly defining the encoding of your strings in every script will save you a lot of headaches down the road.

However, I feel that this is wrong. People need to setup php correctly to support UTF-8, not changing config at runtime.

@iio7
Copy link
Author

iio7 commented Dec 12, 2020

Also, as documented, the default charset for PHP 5.6 and onwards is already set for "UTF-8". All the md_ options, as long as they are unset, are UTF-8.

@iio7
Copy link
Author

iio7 commented Dec 12, 2020

If at all necessary to address this issue, the advice should be to make sure that the default value of default_charset is set to "UTF-8" in php.ini, and then only use mb_internal_encoding if you haven't got access to php.ini.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants