2012-11-26 31 views
2

代碼剪斷:金桂冠unescape_html()

U8 test[20] = "+45%2%205678"; 
printf("\n%s\n",test); 
unescape_html(test); 
printf("%s\n",test); 

輸出

+45%2%205678 
45 1234 5678 

在哪裏我的 「+」 號去了?錯誤或功能?

+1

WebnetMobile.com的的answere把我在正確的方向 –

回答

2

URL編碼+用於替換空格。確保你實際上不會得到" 45 1234 5678"

+0

謝謝很多 - JS替換(「+」,「%2B」)在.value上讓老太太再次唱歌。 –

1

當一個URL編碼的+號表示空間,讓你的函數unescape_html()是去除+標誌

例如:

http://www.example.com/?text=A+blue+sky&something_else=A+red+sky