The question of url address escaping is that you need to obtain the remote page content: mp3.baidu. comm? Fms & amp; tnbaidump3 & amp; rftaste & amp; ct134217728 & amp; lf & amp; rn & amp; word classic old songs & amp; LM-1 & amp; ieutf-8 & amp; pftags #1 no problem with url address escape during my local (WINDOWS) test
You need to obtain the content of the remote page:
Mp3.baidu.com/m? F = ms & tn = baidump3 & rf = taste & ct = 134217728 & lf = & rn = & word = classic old songs & lm =-1 & ie = UTF-8 & pf = tags #1
No problem during my local (WINDOWS) test, but on the server (Linux), the obtained content is incorrect.
Then I tried to use the urlencode () method to escape the Chinese "classic old songs ":
Http://mp3.baidu.com/m? F = ms & tn = baidump3 & rf = taste & ct = 134217728 & lf = & rn = & word = % E7 % BB % 8F % E5 % 85% B8 % E8 % 80% 81% e6 % AD % 8C & lm =-1 & ie = UTF-8 & pf = tags #1
The obtained content is correct.
What is the problem ??
------ Solution --------------------
The default character set of the Chinese window is GBK.
The default character set in Chinese linux is UTF-8.
This is where the problem is located.
------ Solution --------------------
Discussion
Reference:
The default character set of the Chinese window is GBK.
The default character set in Chinese linux is UTF-8.
This is where the problem is located.
Sorry, I don't quite understand it ~
The process I understand is:
When a script requests an address that contains Chinese characters, the server automatically converts it to URL encoding format.
What is the relationship between the conversion process and the character set of the system?