There is an htmlent filter, but I don't think it does exactly what you want.
I think you would need a custom modifier. This might get you close (requires PHP 5.4 or higher):
Create a snippet called RemoveCrap with this code:
/* RemoveCrap snippet */
function replace_invalid_byte_sequence($str) {
return htmlspecialchars_decode(htmlspecialchars($str, ENT_SUBSTITUTE, 'UTF-8'));
}
return replace_invalid_byte_sequence($input);
Then use this tag:
[[+longtitle:RemoveCrap]]
There is a solution here (the one with the most votes) that will actually replace the bad characters instead of deleting them, but you have to download a file to make it work:
http://stackoverflow.com/questions/1401317/remove-non-utf8-characters-from-string