use strict; use utf8; ${^WIDE_SYSTEM_CALLS} = 1; no warnings 'utf8'; binmode(STDOUT, ":utf8"); my $text = chr(0x95);# usually a string read in from a file. print ord ($text), "$text\n"; $text=~s/"\x{0095}"/"\x{017E}"/g; print ord ($text), "$text\n";