Sometimes you just need to URL encode a string (URLEncodedFormat() in CF, or urlencode() in PHP), and not actually make a HTTP request. Here’s a simple library for you to use, that I wrote for my OAuth actionscript lib.
Attached is URLEncoding.as for your enjoyment.







Couldn’t you just use escape() instead?
http://livedocs.adobe.com/flex/3/langref/package.html#escape()
Yep, you can. I didn’t find that until about a day after I wrote this.
That ALWAYS seems to happen
Still, nice work!
How about HTML-escape as opposed to URL-escape?
That is, I want to convert as string like this:
“”
to something like this:
“<a href=’http://www.google.com/search?hl=en&q=as3+escape’>”
Looks like there is no build-it method. Or is there?
oops, there is a bug in this blog - it should not linkify escaped html entities; and note, this is a potential security threat!
ok, so here is my original string (spaces replaced with underlines):
___
and this is what i want to get:
__<a_href=’http://www.google.com/search?hl=en&q=as3+escape’>__
wow, never thought wordpress is so crappy at this, it does not do decent HTML-escaping — ironically, just the thing that was focusing on..