My solution below was slightly incorrect, so here is the correct version (I posted at the end of a long day, never a good idea!)
Again, this is a quick and dirty solution to stop mb_convert_encoding from filling your string with question marks whenever it encounters an illegal character for the target encoding.
<?php
function convert_to ( $source, $target_encoding )
{
$encoding = mb_detect_encoding( $source, "auto" );
$target = str_replace( "?", "[question_mark]", $source );
$target = mb_convert_encoding( $target, $target_encoding, $encoding);
$target = str_replace( "?", "", $target );
$target = str_replace( "[question_mark]", "?", $target );
return $target;
}
?>
Hope this helps someone! (Admins should feel free to delete my previous, incorrect, post for clarity)
-A