2016-03-04 96 views
0

我有以下字符串LIVEWIRE TS+爲什麼剃鬚刀與Server.UrlEncode產生不正確的結果?

當我做下面的代碼:

<a href="/support/[email protected]("LIVEWIRE TS+")" class="topic-knowledge-base button">KNOWLEDGE BASE</a> 

它產生下面的查詢字符串:

LIVEWIRE+TS%2b

我想到了一個空間是%20時編碼。

好的,在解碼之後,我找回了LIVEWIRE TS,但沒有收到LIVEWIRE TS+。我怎樣才能保留+號?

+2

請參閱http://stackoverflow.com/questions/1634271/url-encoding-the-space-character-or-20 – xanatos

+1

+是空格鍵,%20是加號。 – Sousuke

+1

沒有空格是'+'編碼時如果你想要你可以在這裏查看http://www.url-encode-decode.com/ – Tushar

回答

0

對其進行解碼,讓你不得不使用此代碼相同的字符串:

System.Net.WebUtility.UrlDecode("LIVEWIRE+TS%2b"); 

,它將返回LIVEWIRE TS+

相關問題