Need help in replacing special characters

I am writing a ksh script. I need to replace a set of characters in an xml file.

FROM="��������������������������������������������������������";
TO="AAAAAAACEEEEIIIIDNOOOOOOUUUUYSaaaaaaceeeeiiiionooooo N R"

I have used the code- sed 's/$FROM/$TO/g'<abc.xml

But its not working.
Can anyone tell me the code to do this?

The sed you've posted will look for the exact string of characters in FROM and replace it with the entire string in TO. I think you want to do a one for one translation for each time characer X appears translate it to a matching character Y from the second set. If that is the case, try:

tr "[$FROM]" "[$TO]"  <input.xml >output-file

I don't use translate hardly at all, but this seemed to work in the quick test that I just ran.

Not sure if this is what you're looking for.

Using Perl:

cat file
FROM="��������������������������������������������������������";
TO="AAAAAAACEEEEIIIIDNOOOOOOUUUUYSaaaaaaceeeeiiiionooooo N R"

perl -ple 's/[^A-Za-z0-0\=\;\"]//g' file
FROM="";
TO="AAAAAAACEEEEIIIIDNOOOOOOUUUUYSaaaaaaceeeeiiiionoooooNR"

Hope this helps.

Yes,we need to search for the special characters & each time it occurs,it should replace it with the corresponding character in the file.