Use $ZCVT function with HTML or JS conversion tables (well it you use the built-in CNLS
locales, but not those not uptodate locales mentioned here recently):
CACHE509:USER:.000118>w $zcvt("unescaped'and""","o","JS")
unescaped\'and\"
CACHE509:USER:.000124>w $zcvt("unescaped'and""","o","HTML")
unescaped'and"
Regards,
Timur
On 11.08.2004 21:53, John A. Bertoglio said the following:
I need to be able to escape text in parameters being passed by a javascript
function. IIRC, there is one in the %wldxxxx utility files. I need to
convert characters like single and double quotes, etc to %nn so it can be
passed without blowing up the script. I know I can use the methods one of
the V5 classes but I don't what all the overhead for such a simple task and
also want the code to work on older systems.
BTW, for those who care the WLD routines contain a wealth of useful things,
especially for text manipulation. Simple COS, well documented and fast.
Thanks to Rob for this great side benefit.
Thanks to all in advance.