Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
629 views
in Technique[技术] by (71.8m points)

url - Why do some websites have ?utf8=? in their title?

I've noticed that a lot of websites, when searching or just browsing, will add a get variable called utf and set it equal to a check mark (?utf8=?).

Two examples are:

  • Dotabuff has its search URL include it. Example: dotabuff.com/search?utf8=?&q=PPD

  • Bibme also has its search URL include it. Example: bibme.org/mla/website-citation/search?utf8=?&q=someurl.com

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

URIs contain utf8=? to force the client to send UTF-8.
It works because the key-value-pair (which is ignored by the target) contains a unicode-only character.

From Is the use of “utf8=?” preferable to “utf8=true”?:

By default, older versions of IE (<=8) will submit form data in Latin-1 encoding if possible. By including a character that can't be expressed in Latin-1, IE is forced to use UTF-8 encoding for its form submissions, which simplifies various backend processes, for example database persistence.

If the parameter was instead utf8=true then this wouldn't trigger the UTF-8 encoding in these browsers.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...