Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有从数据库中检索标签的 WCF REST 服务。一些标签中包含特殊字符,如 &、+、#、(、)。我可以通过对查询字符串进行 url 编码来检索带有 #、( 和 ) 的标签。
但是我无法通过对查询字符串进行 url 编码来检索带有 '&' 和 '+' 的标签。
我想知道这个问题的解决方案。
谢谢
兑换
+ => %2b & => %26 , => %2c
更新:
但是对于“#”它是不可能的,因为,# 字符之后的任何内容都不会发送到服务器端,你只能在客户端使用 javascript
a+b 写成 a%2Bb
a&b 写成 a%26b