Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

URL Encoding

Charlie Columbia
Registered User
Join date: 11 Oct 2005
Posts: 55
01-24-2007 10:59
Does anyone know an easy way to encode special characters that I can pass with a URL. I'd like to be able to pass a URL in a URL to my server and then decode it on the server and use it.
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
01-24-2007 11:35
llEscapeURL()/llUnescapeURL().

Fair warning: llEscapeURL() seems to have a lame limit on the length of the string it'll output. It will not output more than 255 characters, so if you want to encode more than 80 or so special characters, you may need to write a function to encode them in chunks.
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
01-24-2007 11:39
It's also fairly simplistic, escaping pretty much any non-alphanumeric character as %hh. In some cases, where you need spaces escaped to plus signs, for example, you will have to write your own function.