in reply to Detecting Strange Characters in Text?
s/([^\x20-\x7F])/'&#' . ord($1) . ';'/gse; [download]