Solved

Special chars in textarea fields --> MySQL

Posted on 2011-09-14
2
320 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
[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 60

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 51

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

Do you have a plan for Continuity?

It's inevitable. People leave organizations creating a gap in your service. That's where Percona comes in.

See how Pepper.com relies on Percona to:
-Manage their database
-Guarantee data safety and protection
-Provide database expertise that is available for any situation

Question has a verified solution.

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

All XML, All the Time; More Fun MySQL Tidbits – Dynamically Generate XML via Stored Procedure in MySQL Extensible Markup Language (XML) and database systems, a marriage we are seeing more and more of.  So the topics of parsing and manipulating XM…
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…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

688 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