corrected JS regex and changed the escape replacer to encode in \u00HH format