merrymonk has asked for the wisdom of the Perl Monks concerning the following question:
since these preserve the font (and all other characteristics) of the characters that are identical to whatever is in $oldtext.I also am comfortable with using definitions of the old text such as "\x{00BD}".The problem comes with any characters from wingdings. As a test I created a Word document that contained only a ‘pencil’ pointing from top right to bottom left.According to Word, this has a hex value of 0021. I then used the following three lines of Perl hoping to get the next wingding characters (scissors)$search-> {Text} = $oldtext; $replace-> {Text} = $newtext; $search-> Execute({Replace => wdReplaceAll});
$exec_res returned a value of 0 and the replacement had failed. Searching the net I found a site (http://www.alanwood.net/demos/wingdings.html) that was headedWingdings character set and equivalent Unicode characters. This showed that the Unicode Hex values for the pencil and scissors are U+270F and U+2702 respectively.Therefore I altered the search and replace lines to$search-> {Text} = "\x{0021}"; $replace-> {Text} ="\x{0022}"; $exec_res = $search-> Execute({Replace => wdReplaceAll});
and as this did not work even tried$search-> {Text} = "\x{270F}"; $replace-> {Text} = "\x{2702}";
which also failed. How can I overcome this failure? In my net searches I have found other instances where people have had problems with wingding and similar characters. Sadly none of these gave the answer I was looking for.$search-> {Text} = 'U' . "\x{270F}"; $replace-> {Text} ='U' . "\x{2702}";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl Word and Wingdings
by linuxer (Curate) on Dec 31, 2008 at 10:36 UTC | |
by merrymonk (Hermit) on Dec 31, 2008 at 14:52 UTC | |
|
Re: Perl Word and Wingdings
by jhourcle (Prior) on Dec 31, 2008 at 15:02 UTC | |
|
Re: Perl Word and Wingdings
by graff (Chancellor) on Dec 31, 2008 at 15:53 UTC | |
by merrymonk (Hermit) on Dec 31, 2008 at 16:48 UTC | |
by merrymonk (Hermit) on Dec 31, 2008 at 17:27 UTC |