Insert ASCII charaters

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark Anderson

    #1

    Insert ASCII charaters

    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


  • Evertjan.

    #2
    Re: Insert ASCII charaters

    Mark Anderson wrote on 28 aug 2004 in comp.lang.javas cript:
    [color=blue]
    > 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?.[/color]

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

    # is the example delimiter
    1D is hexadecimal for 29
    [color=blue]
    > 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.[/color]

    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.


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress,
    but let us keep the discussions in the newsgroup)

    Comment

    • Mark Anderson

      #3
      Re: Insert ASCII charaters

      > t = t.replace(/#/g,'\x1D')[color=blue]
      >
      > # is the example delimiter
      > 1D is hexadecimal for 29[/color]

      Thanks

      Mark


      Comment

      Working...