I'm losing accented characters.
From PHP I download an xml file which uses UTF8, while my PHP script uses Latin1. I can't manage to convert the UTF8 into Latin1.
I've tried this:
$meta=mb_convert_encoding($meta,'CP1252','UTF-8');
and
$meta=mb_convert_encoding($meta,'UTF-8');
$meta=mb_convert_encoding($meta,'CP1252','UTF-8');
But either way the accented characters are broken and turned into 2 characters.
Input:
<title>First book of zoölogy</title>
Output:
<title>First book of zoo?logy</title>
I figured it out myself, see my answer below. Thank you everyone for your help!