in reply to Re: unknown character in between text
in thread unknown character in between text

eeew :p

s/([^\000-\200])/'&#'.ord($1).';'/ge s/([^\000-\200])/sprintf '&#x%X;', ord $1/ge

Replies are listed 'Best First'.
Re^3: unknown character in between text
by DanielSpaniel (Scribe) on Sep 17, 2011 at 13:05 UTC

    :-) That looks tidier! Haven't tested it, but I get the gist ... I knew someone would be able to condense into a handful of bytes! But why 200 in the character class? I'm sure there must be a good reason, but I think I am more familiar with just seeing \000-\177

        D'oh! 127 is 177 octal, totally misread it, typical off-by-one error