Click here to Skip to main content
15,895,813 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I use the URL below to insert a record through a WCF into Oracle DB:
JavaScript
<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>]

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:

JavaScript
How to encode '+' in URL in order to save the record into Oracle DB
Posted
Updated 30-Nov-16 0:01am
v2
Comments
Wendelius 29-Nov-16 16:17pm    
What is the code for saving the URL into the database?
Peter_in_2780 29-Nov-16 18:43pm    
Have you tried the obvious, encoding as %2B ?

1 solution

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...
 
Share this answer
 
Comments
s yu 30-Nov-16 7:09am    
GREAT! Thanks.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900