Question about url address escape

Source: Internet
Author: User
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?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.