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

Im generating URLs for my AdWord campaigns and some campangin names have brackets in them ( ) and [ ] brackets. And a sample url looks likes this

http://www.website.com/?utm_source=google%5BB%2B%5D&utm_medium=cpc&utm_content=google_ad(B)&utm_campaign=product

Is this fine?

See Question&Answers more detail:os

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

1 Answer

Parentheses “()” may be used as such in the query part of URL (i.e., the part after “?”). It is allowable, but not necessary, to %-encode them, as “%28” and “%29”.

Brackets “[]” shall be %-encoded, as “%5B” and “%5D”, in the query part.

The sample URL, which is a real URL as www.website.com actually exists (please use www.example.com as a dummy domain name, it is guaranteed to not exist), is thus correctly formed.

The general rules for URL syntax are defined in Internet-standard STD 66, which is currently RFC 3986. Its Appendix A specifies the rules for characters, listing parentheses as belonging to the “sub-delims” group which is allowed without %-encoding in the query part but the brackets as belonging to “gen-delims” which shall be %-encoded.


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