use HTML::Entities;
$output = encode_entities($str);
Sometimes the above function generates �
which does not display in a browser, like this: �
What is the problem and how can I get entities like this to display properly?
Would encode_entities_numeric
be better instead?
EDIT: Should I use the following instead?
use HTML::Entities;
utf8::decode($str);
$output = encode_entities($str);