如何在URL中编码'+'以便将记录保存到oracle DB中 [英] How to encode '+' in URL in order to save the record into oracle DB
本文介绍了如何在URL中编码'+'以便将记录保存到oracle DB中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用下面的URL通过WCF将记录插入Oracle DB:
I use the URL below to insert a record through a WCF into Oracle DB:
<a href="http://xxx/TransInfo.svc/Json/JAddOffsetInfo?&offsetID=6039&monID=9757&station=12+05"></a>[<a href="http://xxx/TransInfo.svc/Json/JAddOffsetInfo?&offsetID=6039&monID=9757&station=12+05" target="_blank" title="New Window">^</a>]
我有值'12 +05'保存为'12 05'的问题,这意味着过滤了'+'符号。我也尝试在URL中使用'+'作为'+'。但'12 +05'保存为'12',这意味着第二部分被过滤掉了。
如何对'+'字符进行编码,以便将其正确保存到Oracle DB中(就像网址中的空格是'%20')?谢谢。
我的尝试:
I got the problem that the value '12+05' is saved as '12 05', which means the '+' sign is filtered. I also tried use '+' for the '+' in the URL. But the '12+05' is saved as '12', which means the 2nd part is filtered out.
How can the '+' character be encoded so that it can be properly saved into Oracle DB (like a space in url is '%20')? Thanks.
What I have tried:
How to encode '+' in URL in order to save the record into Oracle DB
推荐答案
问题是在原始网址中标准+是一个空格...
将它替换为%2B并且所有都应该正确...
但它甚至应该最好对整个字符串进行URL编码...
The problem is that in the original URL standard + is a space...
Replace it with %2B and all should go right...
However it even should be better to URL encode the whole string...
这篇关于如何在URL中编码'+'以便将记录保存到oracle DB中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文