Possibly a typo in either your code or when posting; regardless, \x{BC} is 1/4 as a single character, not mu.
Both substitution and transliteration work, as shown in the code below. [I used the /r option for demonstration purposes. You may not need or want this; but, if you do, you'll need Perl v5.14 or later to use it (see "perl5140delta: Non-destructive substitution").]
$ perl -E ' use strict; use warnings; use utf8; use open OUT => qw{:encoding(UTF-8) :std}; use Unicode::UCD "charinfo"; say "\x{B5} = ", charinfo(0xB5)->{name}; say "\x{BC} = ", charinfo(0xBC)->{name}; say "\x{3BC} = ", charinfo(0x3BC)->{name}; my $contents = "\x{B5} \x{BC} \x{3BC}"; print "Original \$contents: "; say $contents; print "Non-desctructive s///: "; say $contents =~ s/[\x{B5}\x{3BC}]/u/gr; print "Unchanged \$contents: "; say $contents; print "Non-desctructive y///: "; say $contents =~ y/\x{B5}\x{3BC}/u/r; print "Unchanged \$contents: "; say $contents; '
Output:
µ = MICRO SIGN ¼ = VULGAR FRACTION ONE QUARTER μ = GREEK SMALL LETTER MU Original $contents: µ ¼ μ Non-desctructive s///: u ¼ u Unchanged $contents: µ ¼ μ Non-desctructive y///: u ¼ u Unchanged $contents: µ ¼ μ
See also the Unicode PDF code charts: "C1 Controls and Latin-1 Supplement" (for x{B5} & \x{BC}); and, "Greek and Coptic" (for \x{3BC}).
— Ken
In reply to Re: Substituting unicode character leaves special block
by kcott
in thread Substituting unicode character leaves special block
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |