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 ');

CodePudding user response:

reference 1st floor qybao response:
try to transmit the encode
The
Uri=XXX + '& amp; Projectname='+ encodeuri (projectname);

When receiving
Projrctname=decodeuri (request (' projectname ');


Or not, the console log out or the code

CodePudding user response:

This system seems to has carried on the packaging, to request a separate
 & lt; script> 
The function request for (d) {(c=the location of the var. Search. Slice (1). The split (" & amp;" ), a=0; A. & lt; C.l ength; +) {var b=c [a]. The split ("="); If (b [0]==d) if (" undefined "==unescape (b) [1]) break; The else return unescape} [1] (b) return ""};
</script>

I can change through the encapsulation achieve the goal of the Chinese?

CodePudding user response:

reference 3/f thin horse response:
this system seems to has carried on the packaging, to request a separate
 & lt; script> 
The function request for (d) {(c=the location of the var. Search. Slice (1). The split (" & amp;" ), a=0; A. & lt; C.l ength; +) {var b=c [a]. The split ("="); If (b [0]==d) if (" undefined "==unescape (b) [1]) break; The else return unescape} [1] (b) return ""};
</script>

I can change through the encapsulation achieve the goal of the Chinese?

You are against it, encapsulation, the parameters of the time of the escape the try
Uri=XXX + '& amp; Projectname='+ the escape (projectname);

CodePudding user response:

Use the escape, receiving unescape, or gibberish
  • Related