【关键字】
URL / 特殊字符 / 转码
【问题描述】
Andorid对于URL中有特殊的字符,会自动转码,iOS需要手动转才行,鸿蒙会自动转吗?
【解决方案】
鸿蒙对于URL中特殊字符是需要转码的,需要使用到encodeURI()/decodeURI()方法。
相关API档请参考:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI
URL / 特殊字符 / 转码
Andorid对于URL中有特殊的字符,会自动转码,iOS需要手动转才行,鸿蒙会自动转吗?
鸿蒙对于URL中特殊字符是需要转码的,需要使用到encodeURI()/decodeURI()方法。
相关API档请参考:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI