Jump to content


Photo

URL coding


  • Please log in to reply
3 replies to this topic

#1 TeamSteeve

TeamSteeve

    GMC Member

  • GMC Member
  • 919 posts
  • Version:GM:Studio

Posted 05 July 2012 - 07:11 AM

Does anybody know a quick way to convert a string that may included spaces and characters like hash and ampersand into the correct coding for a URL.
A quick forum search turned up nothing.

Obviously I want to do this in game.
If it's not easy, just let me know. I'm trying to put something together for this weekend and I don't know php (which seems like it would be good for what I'm doing but I don't have time to learn it).

Thanks in advance for any help.
  • 0

#2 Eyas

Eyas

    GMC Member

  • GMC Member
  • 763 posts
  • Version:GM:Studio

Posted 08 July 2012 - 06:39 PM

http://en.wikipedia....ercent-encoding

Only way I can think of is to go through each item in the "Percent-encoding reserved characters" and "Character data" sections in the article above, and for each of these, call a string_replace_all to do that.
  • 0

#3 iSeiren

iSeiren

    www.DWorrall.com

  • GMC Member
  • 441 posts
  • Version:GM:Studio

Posted 08 July 2012 - 07:11 PM

Web browsers generally use %20 as the replacement for spaces in URL's. Just parse that out.
  • 0

#4 TeamSteeve

TeamSteeve

    GMC Member

  • GMC Member
  • 919 posts
  • Version:GM:Studio

Posted 09 July 2012 - 01:58 AM

Yeah, it's a bit late now as I already did what I planned. I did do it manually with string_replace_all, I was hoping for an easier way though as I was in a rush.
Thanks anyway.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users