I've created simple PHP script that gets content of file. After iconv function is changing encoding to UTF-8. Everything is working correctly on my localhost (PHP 7). Problem is that it isn't working on website with PHP 5.5.21 installed. I really need to fix it so it will work on 5.5.21 too.
iconv(): Detected an illegal character in input string in FILE-PATH
Code that isn't working on 5.5 but is on 7:
$file = file_get_contents($_FILES['csvfile']['tmp_name']);
$c = iconv(iconv_get_encoding($file),"UTF-8",$file);