Suggestion: $translate function

It would be great to have a scripting function to help in converting alphabets for e.g. /t/6298/1 and my previous queries likewise.


Command: $translate(string,from,to)
Result: string having each character found in from either replaced by the character at the from-corresponding position in to, or if that position is past the end of to, deleted.
Example: $translate(Dónde,áéíóúüñÁÉÍÓÚÑÜ,aeiouunAEIOUNU) returns Donde
This example removes the accents from characters used in Spanish.

If there's a better solution, please do say.