I'm moving everything to a new server. The old server used PHP v. 5.2.17, and the new one is 5.4.25.
One function I used fairly often when importing content from another site was iconv(), like so:
$var = iconv("UTF-8", "ISO-8859-1//IGNORE", $var);
On the new server, though, this is returning false (or maybe just empty), leaving me with nothing but a blank variable. If I remove the line, everything is fine, so iconv() is definitely the problem.
I did a little digging, and found that iconv() does have a bug specifically when using //IGNORE, but unfortunately for me, that's pretty important:
[
bugs.php.net...]
I tried the recommended fix, which didn't give any errors, but didn't convert anything, either:
ini_set('mbstring.substitute_character', "none");
$text= mb_convert_encoding($text, 'UTF-8', 'ISO-8859-1');
I don't exactly want to use ini_set() on so many scripts, anyway, so I still don't know if this is the best choice.
Can you guys recommend an alternative to iconv() that would accomplish the same thing?