?
Solved

Special Character endcoding for mysql, coldfusion

Posted on 2013-11-03
2
Medium Priority
?
387 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 500 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 500 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
By, Vadim Tkachenko. In this article we’ll look at ClickHouse on its one year anniversary.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

801 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