Although you should ideally resolve the encoding issues elsewhere, you can use the iconv function to try converting.
iconv ( string $in_charset , string $out_charset , string $str )
could be applied to your code:
iconv("ISO-8859-1", "UTF-8", $user['name'])
The difficulty is identifying the encoding of your source, if you know this then you're good to go.