Solved

Special Character endcoding for mysql, coldfusion

Posted on 2013-11-03
2
381 Views
Last Modified: 2013-12-13
Hello,

I'm having a issue with inputting utf-8 characters into the mySQL db. For example if I setup a form ...

    <cfif isDefined("form.submit")>
        <cfquery datasource="#request.dsn#" username="#request.dsnUsername#" password="#request.dsnPassword#">
        INSERT INTO search
        (term)
        VALUE ('#form.search_terms#')
        </cfquery>
    </cfif>

    <form method="post" id="add_form" action="test.cfm" class="form-inline" accept-charset="ISO-8859-1">
        <input name="search_terms" type="input">
        <input name="submit" type="submit">
    </form>


and I enter Japanese characters, I get &#12486;&#12452; entered into the db column which is set at utf-8. I would like to have  Japanese characters as the entry. If I manually enter it in using Navicat it enters just fine that way and displays them without them encoded.

Thanks for any help,
0
Comment
Question by:brihol44
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 125 total points
ID: 39620974
If you want UTF-8, why do you have accept-charset="ISO-8859-1" in your form tag?
0
 

Accepted Solution

by:
jessemtcarlton earned 125 total points
ID: 39699363
You will also need to save your .cfm page as UTF-8 and set the encoding in your HTML declaration to UTF-8: <meta charset="utf-8">.  basically you have to tell the browser and your web server to use UTF-8 or there can be encoding mismatches.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question