Javascript decodeURIComponent抛出错误“;URIError:decodeURIComponent处的URI格式不正确;因为它无法从php中解码rawurlencode(数据)

Javascript decodeURIComponent抛出错误“;URIError:decodeURIComponent处的URI格式不正确;因为它无法从php中解码rawurlencode(数据),javascript,php,url-encoding,decodeuricomponent,Javascript,Php,Url Encoding,Decodeuricomponent,decodeURIComponent在php中解码编码数据时抛出错误 数据在PHP中使用rawurlencode函数进行编码,而在js中进行解码时,我们使用的是decodeURIComponent 对于少数数据,我得到了其他值的错误,它工作正常 问题: 我想知道除了rawurlencode或decodeURIComponent欢迎来到stackoverflow sunil:)。如果您提供您的代码或您迄今为止尝试过的任何内容,ppl将很容易给出您的答案&如果您遇到任何错误或其他问题,请提供错误日志

decodeURIComponent
在php中解码编码数据时抛出错误

数据在
PHP
中使用
rawurlencode
函数进行
编码,而在
js
中进行
解码时,我们使用的是
decodeURIComponent

对于少数数据,我得到了其他值的错误,它工作正常

问题:
我想知道除了
rawurlencode
decodeURIComponent

欢迎来到stackoverflow sunil:)。如果您提供您的代码或您迄今为止尝试过的任何内容,ppl将很容易给出您的答案&如果您遇到任何错误或其他问题,请提供错误日志,异常等,所以用户可以很容易地转到该方向并向您提供帮助感谢用户1140237:)抱歉,用户1140237,因为我无法提供任何日志,因为我在一家公司工作,但我的问题与此类似,但对我没有任何帮助。我找到了发生这种情况的原因流程:从db获取数据-->使用php编码数据rawurlencode()----->将数据发送到前端---->使用decodeURIComponent()对数据进行解码,处理并显示数据。问题:Db具有特殊的特性�()未正确编码,因此decodeURIComponent函数抛出错误。