使用decodeURIComponent函数转换
示例:https://mp.csdn.net/creation/editor?spm=测试数据
我们使用方法获取到的URL地址为: https://mp.csdn.net/creation/editor?spm=%0xxxxxxxxxx 一堆乱码
使用 decodeURIComponent(src) 后转换为正常中文:
https://mp.csdn.net/creation/editor?spm=测试数据