as you may know, there is that code-block »Mathematical Alphanumeric Symbols« U+1D400..U+1D7FF
, containing styled letters and digits that look like normal characters from the latin alphabet, just styled in bold or italic available in UniCode.
Now i tried to use a simple transformation operation to transform some normal text into "bold" UniCode text and as naive as i am i did this:
my $CharSet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012
+3456789'; # ASCII
my $BoldSet = '𝐚𝐛𝐜𝐝𝐞𝐟&
+9;𝟖𝟗'; # UniCode bold
my $Source = 'The quick brown fox jumps over the lazy dog 1234567890 t
my $Target = $Source;
$Target =~ tr/$CharSet/$BoldSet/;
To my surprise, the output was this:
The quick brown fox jumps over the lazy dog 1234567890 times.
Toe quick bdown fox jumps oved toe llzy dog 1234567890 times.
No trace of bold UniCode characters, but some characters garbled.
Does "tr" not work correctly with Unicode?
I have a »use utf8::all;« in my program and i am using this perl version:
This is perl 5, version 26, subversion 3 (v5.26.3) built for x86_64-li
(with 51 registered patches, see perl -V for more detail)
Thank you very much in advance for your help.
Best regards from Charleston (WV),