http://qs321.pair.com?node_id=558834


in reply to zapping gremlins

Won't this fix your problem?
use HTML::Entities; encode_entities($mystr);
Given, you might still want the curly quotes replaced with flat quotes, but if your object is just to make the text display properly, this should do the job.