While trying to run a string through PHP\'s htmlentities function, I have some cases where I get a \'Invalid Multibyte Sequence\' error. Is there a way to clean the string prior