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

Categories

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

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

1 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...