Home > front end > For help: the request passed Chinese garbled
For help: the request passed Chinese garbled
Time:10-13
In A page using the
url: top. $. RootUrl + '/Zjjg/ZJJG_Feedback/Form? + ProjectID ProjectID='+' & amp; ProjectName='+ ProjectName,//here is passing the ProjectName . The console. The log (ProjectName);//verification can show Chinese normal
Pass two parameters ProjectID and ProjectName. ProjectID in English for the whole, can be normal delivery ProjectName contains Chinese In the current page to the console. The log can display the normal Chinese
In page B, use the
var ProjectName=request (' ProjectName ');//here for a Chinese garbled
The console. The log (ProjectName);//shown here is the code
The code is this:
?? ¢e? 3 e?? E??????? XXe? 1??????
Don't like being encoded URI after some %, such help
In page b interviewed the
var ProjectName=decodeURI (request (' ProjectName '))//a layer of
var ProjectName=decodeURI ((decodeURI (request (' ProjectName ')))//two layers of
And unescape (layer and layer), decodeURIComponent (layer and layer) are not, or get the code
CodePudding user response:
Try to transmit the encode The Uri=XXX + '& amp; Projectname='+ encodeuri (projectname);
When receiving Projrctname=decodeuri (request (' projectname ');