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.
代码片段:
U8 test[20] = "+45%201234%205678"; printf("\n%s\n",test); unescape_html(test); printf("%s\n",test);
输出
+45%201234%205678 45 1234 5678
我的“+”号去哪儿了?错误或功能?
在 URL 编码+中用于替换空格。确保你没有得到" 45 1234 5678"事实。
+
" 45 1234 5678"
当 URL 被编码时,该+符号表示一个空格,因此您的函数unescape_html()正在删除该+符号
unescape_html()
例如:
http://www.example.com/?text=A+blue+sky&something_else=A+red+sky