I have a question about the correct use of
$mysqli->set_charset()
. I haven't used this feature on my site for years. Now I'm rewriting my connection script, and want to apply $mysqli->set_charset()
properly. At the moment the site is still based on 'latin1' (but I will soon switch to UTF-8 (utf8mb4).)
MySQLi on my server (which I manage myself) has been configured with latin1 for years. I assume it wouldn't hurt to add this $mysqli->set_charset("latin1")
now?
And is it true that if MySQLi were configurated with utf8mb4 by default, without that $mysqli->set_charset()
function it would be a party on my site with weird encoding characters?
I'd like to make sure about my assumption.