$s = "\xe7abc\xe7"; $s =~ s[@{[chr 231]}][X]g; print $s; XabcX