Insert ASCII charaters

M

Mark Anderson

I need to replace an existing delimiter in a text string with ASCII #29.

(a) Is this possible?
(b) Any traps to beware of, handling strings with 'odd' chars embedded
in them?.

The #29-delimited string will be created in a web form and submitted to
an ASP page which will write the data to a TXT file for merge into a
flat file database (at the end of the process).

I could do the delimiter change server side in ASP as I don't see any
native JS ASCII character handling methods but I'd like to do the
process at source during validation, if I can.

Regards

Mark
 
E

Evertjan.

Mark Anderson wrote on 28 aug 2004 in comp.lang.javascript:
I need to replace an existing delimiter in a text string with ASCII
#29.

(a) Is this possible?
(b) Any traps to beware of, handling strings with 'odd' chars embedded
in them?.

t = t.replace(/#/g,'\x1D')

# is the example delimiter
1D is hexadecimal for 29
The #29-delimited string will be created in a web form and submitted
to an ASP page which will write the data to a TXT file for merge into
a flat file database (at the end of the process).

I could do the delimiter change server side in ASP as I don't see any
native JS ASCII character handling methods but I'd like to do the
process at source during validation, if I can.

It does not matter if you do the above javascript clientside or
serverside under ASP/javascript or thanslated to ASP/vbscript.

In general, all that can be done serverside, out of the hands of hackers
and experimenting juveniles, should be done there.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top