I have many HTML files containing mixed unicode strings like
\303\243 and printable characters like
%s. What I'd like to do is converting the unicode strings into printable characters in a safe way.
I found that printf from GNU coreutils converts them automatically, but I also learned the hard way some time ago that printf is not trustworthy if you don't know what is going to be printed:
$ env printf "$(cat filename.htm)" printf: %20M: invalid conversion specification
I also know that bash can do conversions like this, but I'd have to loop through the file with a regex, which is not safe at all:
$ echo $'\303\243' ã
Is there such a command-line tool that can process these files in a clean and safe way?