JavaScript reemplaza a Char si no presenta otro personaje
var arr = ["pippo%12pluto%_prova", "ori%_aa"];
for (i=0; i<arr.length; i++) {
console.log( arr[i] + ' => ' + arr[i].replace(/(^|[^'])'(?!')/g, "$1''") );
}
Easy Eel