[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 432
  • Last Modified:

how to escape the underscore in a link

Hello,

I'm building a link that has an encrypted key that we generate and that key can include the underscore character.  I'm using the below link to post to some social sites and when the user clicks the link it strips off the "_".  Any ideas on how to escape this or how to build the link so that the "_" is included in the users request?

http://mysite/EDG_
0
cgray1223
Asked:
cgray1223
  • 2
1 Solution
 
earthsoundCommented:
In HTML, the escape code for underscore is _
0
 
boboudreauCommented:
You can try replacing the underscore with the unicode equivalent (perhaps they don't check for this value).

Any of these should work:

&#000005F
&#00005F
&#0005F
&#005F
&#05F
&#5F

0
 
cgray1223Author Commented:
maybe it's a facebook issue as other social sites handle it, but when I paste in http://linkcontextroot/EM6_;  the escape code doesn't get converted to the _.  I need the _ to be interpreted as a _.  I tried the Unicodes as well
0
 
boboudreauCommented:
Can you try to handle this instead on your server?  I.e., if facebook won't change &#95 or &#005F, can you decrypt those into ASCII before using that string as a key for your web application?
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now