Professional Web Applications Themes

Converting special characters? - PERL Beginners

I've been given the job of writing a CGI script to receive the data from a form and append it to a text file. Later, the text file will be yzed using MS Access. My problem is escaping characters which are often used as delimiters in text-based importing formats, such as ' or " or \t or \n. Any of these could be legitimately entered by a user into the text fields of the form. I'd like to capture these, and not just discard them, and in such as way that they can be easily converted back into the original ...

  1. #1

    Default Converting special characters?

    I've been given the job of writing a CGI script to receive the data from a form and append it to a text file. Later, the text file will be yzed using MS Access. My problem is escaping characters which are often used as delimiters in text-based importing formats, such as ' or " or \t or \n. Any of these could be legitimately entered by a user into the text fields of the form. I'd like to capture these, and not just discard them, and in such as way that they can be easily converted back into the original characters after importing into Access.

    Is there a standardized or commonly accepted way of doing this?

    I first looked at HTML::Entities, but it doesn't look as if it converts \t or \n. Otherwise, this would be a good choice. I also looked at Unicode::Strings, but it seemed as if this would convert the entire string to Unicode, which I don't know if Access accepts, or if this would even solve my problem.

    The form is an Adobe .pdf form with editable fields, which returns the data as an .fdf file. Don't think this is important, but you can learn more about it at http://www.adobe.com/support/techdocs/27f9a.htm.

    I tried searching CPAN on 'encoding' but that didn't seem to be the right term.

    Thanks for your help and advice.

    -Kevin


    -----
    E. Kevin Zembower
    Internet Systems Group manager
    Johns Hopkins University
    Bloomberg School of Public Health
    Center for Communications Programs
    111 Market Place, Suite 310
    Baltimore, MD 21202
    410-659-6139

    Kevin Guest

  2. #2

    Default Re: Converting special characters?

    > I've been given the job of writing a CGI script to receive the data
    from a form and append it to a text file. Later, the text file will be
    yzed using MS Access. My problem is escaping characters which are
    often used as delimiters in text-based importing formats, such as ' or "
    or \t or \n. Any of these could be legitimately entered by a user into
    the text fields of the form. I'd like to capture these, and not just
    discard them, and in such as way that they can be easily converted back
    into the original characters after importing into Access. 
    converts \t or \n. Otherwise, this would be a good choice. I also looked
    at Unicode::Strings, but it seemed as if this would convert the entire
    string to Unicode, which I don't know if Access accepts, or if this
    would even solve my problem. 
    data as an .fdf file. Don't think this is important, but you can learn
    more about it at http://www.adobe.com/support/techdocs/27f9a.htm. 
    right term. 

    If possible you should consider using a CSV formatting module, this will
    translate best into Access (which you should avoid completely if
    possible). Text::CSV or even DBI/D::CSV are excellent. These modules
    will allow you to setup your delimiters however you wish, and Access
    should support importing from them.

    helps?

    http://danconia.org
    Wiggins Guest

  3. #3

    Default Re: Converting special characters?

    >>> Wiggins d Anconia <org> 09/29/04 12:08PM >>>
    If possible you should consider using a CSV formatting module, this will
    translate best into Access (which you should avoid completely if
    possible). Text::CSV or even DBI/D::CSV are excellent. These modules
    will allow you to setup your delimiters however you wish, and Access
    should support importing from them.

    helps?

    http://danconia.org

    ===============================
    Helps very much. Thank you, Wiggins.

    -Kevin

    Kevin Guest

Similar Threads

  1. Special characters
    By phil_dude in forum Macromedia ColdFusion
    Replies: 2
    Last Post: September 10th, 02:06 PM
  2. xml and special characters
    By German Hernandez in forum Macromedia Flash Data Integration
    Replies: 4
    Last Post: May 14th, 12:02 AM
  3. More special characters in FH
    By maciekk in forum Macromedia Freehand
    Replies: 1
    Last Post: July 19th, 11:11 AM
  4. Special Characters - Mac vs. PC - Help
    By tracetm2 webforumsuser@macromedia.com in forum Macromedia Director Lingo
    Replies: 2
    Last Post: August 29th, 06:29 PM
  5. Special characters #,$ etc
    By Mark Denham in forum Informix
    Replies: 1
    Last Post: August 1st, 05:19 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139