Solved

Special Character endcoding for mysql, coldfusion

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
CFIf Syntax and Logic 27 46
CheckListBox usage 3 59
coldfusion cfloop help 6 31
SELECT query on two levels (detail and summary) 13 50
Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

777 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