Skip to main content
September 18, 2008
Question

Annoying characters

  • September 18, 2008
  • 4 replies
  • 546 views
Does anyone know how to avoid characters like this ’ getting inserted into the db and output to the screen? In my app I disable bad characters and set everything to UTF-8 but somehow I still end up with this junk. Is there something I can do in my form to kill it on the way into the db? I am using cf7.
    This topic has been closed for replies.

    4 replies

    September 19, 2008
    Well I looked into the database side and I thought I had it solved when the default database character set was utf-8. However, each table in MySQL has to have a character set so I went through each one (and each text row) and set those to utf-8. Perhaps this will solve it.

    Now if there were a way to find and replace the existing mojibake...
    Inspiring
    September 19, 2008
    idesdema wrote:
    > Does anyone know how to avoid characters like this ??? getting inserted into

    the "technical" term for that is mojibake ;-)

    > the db and output to the screen? In my app I disable bad characters and set
    > everything to UTF-8 but somehow I still end up with this junk. Is there

    obviously not all utf-8. got a public page we can see that shows this issue?
    simple code example? what db? what db driver? got both setup right for unicode?
    Inspiring
    September 18, 2008
    Hi,
    You would see this kind of problems when your application is not 100% UTF-8.
    Do you have special characters like German umlaut or Chinese that get inserted into the DB correctly?

    you can always browser to yahoo.de to get some special characters to test your application.

    cheers,
    fober

    Inspiring
    September 18, 2008
    I'll be the first annoying character to attempt an answer.

    Step 1 - decide what you want to do if you encounter any.
    Step 2 - implement that decision.
    September 18, 2008
    Dan... that was bad. :) Usually your responses are useful. What I did was disable anything I didn't want in the db using this....

    <!--- Disable crap characters --->
    <cfquery name="disable" datasource="flyfishingcom">
    SET CHARACTER SET utf8;
    </cfquery>


    But somehow things are still getting output poorly. Single quotes are usually the culprit.