Upgraded php from 5.3.10 to 7.0.15 can't deal with non-English characters?

I think I have solved it. When I updated my original php code, I just replaced my original connect and query calls with
$dsn = mysqli_connect() and
mysqli_query($dsn,$sql)

Apparently there is a new function I should be using as well:
$dsn->set_charset(‘utf8’);

Adding this after the connect makes it all work.