I am trying to replace all special characters in my data to its corresponding unicode value by using search and replace as follows
$data = "data ý ¶ data"; $data =~ s/([^\w\`\~\!\@\#\$\^\&\*\(\)\-\_\=\+\[\{\]\}\\\|\;\:\'\,\<\. +\>\/\?\x22\xA0\s\x25\xA9\xA7])/ord($1)/g;
But the output is : data ord(ý) ord(¶) data
Please suggest as how do we use ord as function in search and replace.Thanks
In reply to replace special character with its unicode by soumyapanda
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |