Skip to main content
May 20, 2009
Question

form submit bug

  • May 20, 2009
  • 1 reply
  • 600 views

I’ve found that when someone copy's and pastes text into a cfform text input that get submitted to a database the form carries over strange symbols occasionally.

This occurs when an apostrophe hyphen m-dash or other symbol is pasted into a text input on a cfform then submitted to our access datasource.

The output when viewed both in a cfoutput and actually in the database show up as square boxes with numbers in them like   0019 0017 0013... (see attached image) Instead of what they should be ' ` or -

I haven't found a way to get this to work other than manually changing the text in the datasource back to the readable symbols that they should be.

any ideas on this?

thanks

    This topic has been closed for replies.

    1 reply

    ilssac
    Inspiring
    May 20, 2009

    astemm wrote:

    any ideas on this?

    Character Encoding.

    You need to make sure your entire system is talking the same character encoding and that this encoding handles all the characters you want it to handle.  This is a big topic that a simple forum post is not going to cover.  ColdFusion has entire sections in the documentation on how to impliment different character encodings in its layer.  You will also need to read up on how to set this in the HTML layer, the database layer and possible the database driver layer.

    May 20, 2009

    Thanks for the quick reply:

    On the html level I will set every page to

    <meta http-equiv="content-type" content="text/html;charset=utf-8">

    the admin pages where the text is submitted wasn't forced to be set to that.

    the submit form does come up as utf-8 in IE and firefox, both set in auto mode,
    but I will set it in the cfm's themselves to see if that helps.

    On the datasource level, the datasource is set to microsoft access,
    not "microsoft access with unicode" I'll test changing that datasource
    connection also in the cf administrator section.

    Any other ideas are appreciated.

    Thanks again

    ilssac
    Inspiring
    May 20, 2009

    You will will also want to investigate the tags and functions for ColdFusion, <cfprocessingDirective...>, <cfcontent...> and setEncoding().

    http://www.adobe.com/support/coldfusion/internationalization/internationalization_cfmx/internationalization_cfmx3.html