Solved

Special chars in textarea fields --> MySQL

Posted on 2011-09-14
2
314 Views
Last Modified: 2012-08-13
I have a text area field that is inserted into a MySQL db field.
For characters like (Microsoft) quotes, and diacritical vowels, the result that gets inserted (and thus displayed when the record is retrieved on the web site), is translated into other characters.

For instance,  apostrophe as in   member's
gets captured as ʉ۪
(not sure that will display here:  three characters      a   epsilon   trademark    )

what is the correct strategy along the way to capture correctly or convert appropriately the common  special characters?
Do i need to fabricate a translation table that is applied prior to db INSERTion?

thanks
0
Comment
Question by:willsherwood
2 Comments
 
LVL 59

Assisted Solution

by:Kevin Cross
Kevin Cross earned 100 total points
ID: 36540455
Typically, this is handled on the front-end application. If this is PHP for example, you can use the functions like mysql_real_escape_strin().
0
 
LVL 50

Accepted Solution

by:
Steve Bink earned 400 total points
ID: 36540722
This has a lot to do with your character set.

First, where is the data coming from?  If it is coming from a web page, you might be receiving ISO-8859-1 (Western/US Latin).  If it is coming from another application, that application will either set its own character set, or use the default from the OS.  

Second, what character set is your server, database, table, field, and connection using?  Note that these are all distinct levels of character set assignment in the database, with different effects at different levels.  For example, your server will set a default character set.  If you do not assign a character set for your connection, you will use the server default.  The database, when it was created, could have been assigned a default character set, or it would have used the server default.  The same with tables (which inherit from the database level) and fields (which inherit from the table level).  

Both of these sets need to match up in order for your special characters to be interpreted properly.  
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

A lot of articles have been written on splitting mysqldump and grabbing the required tables. A long while back, when Shlomi (http://code.openark.org/blog/mysql/on-restoring-a-single-table-from-mysqldump) had suggested a “sed” way, I actually shell …
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 …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now