Solved

Special chars in textarea fields --> MySQL

Posted on 2011-09-14
2
319 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 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Foreword This is an old article.  Instead of using the MySQL extension that was used in the original code examples, please choose one of the currently supported database extensions instead.  More information is available here: MySQLi / PDO (http://…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

732 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