At work today, one of the customer has Hungarian site and need to import csv of their products to database and website will show these in hungarian with UTF-8 encoding on the browser. The text need to be re-encode into UTF-8 before putting in the database, otherwise it will display alien language on the screen instead of Hungarian
The function that can do this is “utf8-encode”

just call utf8-encode($text) and it will return UTF-8 encoded text.