#!/usr/bin/js var str = "%E5%B0%8F%E9%A3%BC%E5%BC%BE"; print(str.replace(/%([0-9A-Fa-f][0-9A-Fa-f])/g, function(m0,m1){ return String.fromCharCode(parseInt(m1, 16)); }));