Macros and Unicode
Posted: 2004-11-11 09:08:43
Perl People,
I am trying to write a simple perl macro to find and replace characters using Unicode hex values (i.e. 0x1E3D) but I can't seem to be able to enter 2-byte hex values. For instance, '$line =~ s/\x41/\x42/g' works but '$line =~ s/\x0041/\x0042/g' does not.
Is there any way to get these macros to work with such values so that I can do Unicode find-and-replace macros? I'm probably missing something but I can't figure out what.
I've got Perl v5.8.1-RC3 installed on my machine if that makes any difference.
Thanks,
STeve.
I am trying to write a simple perl macro to find and replace characters using Unicode hex values (i.e. 0x1E3D) but I can't seem to be able to enter 2-byte hex values. For instance, '$line =~ s/\x41/\x42/g' works but '$line =~ s/\x0041/\x0042/g' does not.
Is there any way to get these macros to work with such values so that I can do Unicode find-and-replace macros? I'm probably missing something but I can't figure out what.
I've got Perl v5.8.1-RC3 installed on my machine if that makes any difference.
Thanks,
STeve.