Solved

Special Character endcoding for mysql, coldfusion

Posted on 2013-11-03
2
383 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

I spent nearly three days trying to figure out how incorporate OAuth in Coldfusion for the Eventful API. Hopefully, this article will allow Coldfusion Programmers to buzz through the API when they need to. Basically, what this script does is authori…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

729 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