先將string編碼編碼
var str = encodeURI("美麗新世界"); //str ==='%E7%BE%8E%E4%B8%BD%E6%96%B0%E4%B8%96%E7%95%8C'
而後解碼code
console.log(decodeURI(str)); //'美麗新世界'