Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
URL character replacement
#1
What's the best way to find and replace these characters using QM?

Basically I need a program that will prepare text to be used in URL variables. So if there is something fancier than just replacing common characters, I'm all for that!

Thanks,
Jimmy Vig

Here's the list of basic characters and what they replace to:
@=%40
#=%23
$=%24
%=%25
^=%5E
&=%26
+=%2B
{=%7B
}=%7D
|=%7C
:=%3A
"=%22
<=%3C
>=%3E
?=%3F
[=%5B
]=%5D
\=%5C
;=%3B
,=%2C
/=%2F
#2
str s
...
s.escape(9)
#3
Wow. That was easy. I had "escape" in the back of my mind, but I couldn't quite grab the idea to even search for it. Totally. Thanks!


Forum Jump:


Users browsing this thread: 1 Guest(s)