I need to be able to encode into the appropriate html entities arbitrary text (pasted from Microsoft Word) which might include unusual characters and symbols. Here's an example string:
“Smart Double Quotes” & Smart Quote’s Em—dash En–Dash© ® ™ á é ü € £
Using the php function htmlentities($text, ENT_QUOTES) doesn't encode everything. (In the example above, the em dash, en dash, trademark symbol and Euro symbol remain un-encoded.) I tried using this variant form: htmlentities($text, ENT_QUOTES, "UTF-8"), but it produced a completely blank string.
Any suggestions?