diff --git a/traydict/unicodereplace.pl b/traydict/unicodereplace.pl index 12dd34190..9ffcbd602 100644 --- a/traydict/unicodereplace.pl +++ b/traydict/unicodereplace.pl @@ -17,13 +17,13 @@ open(OUTFILE, ">:utf8", $outfile) or die("Can't open $outfile: $!"); # loop over lines in the infile while () { - for (split('', $_)) { # loop over characters in the line + for (split('', $_)) { # loop over characters in the line my $cp = ord; - if ($cp < 127 or $cp == 0xFFFE or $cp == 0xFEFF) { # is it a normal ASCII codepoint or a BOM? - print OUTFILE $_; # then pass through unchanged + if ($cp < 127 or $cp == 0xFFFE or $cp == 0xFEFF) { # is it a normal ASCII codepoint or a BOM? + print OUTFILE $_; # then pass through unchanged } else { - print OUTFILE "\\u", sprintf("%04x", $cp); # otherwise print as \uHEX + print OUTFILE "\\u", sprintf("%04x", $cp); # otherwise print as \uHEX } } }