?
Solved

Special chars in textarea fields --> MySQL

Posted on 2011-09-14
2
Medium Priority
?
323 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 400 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 1600 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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
In this article, I’ll talk about multi-threaded slave statistics printed in MySQL error log file.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
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…

765 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