Solved

wierd output after writing apostrophes to the database

Posted on 2003-12-04
2
228 Views
Last Modified: 2013-12-24
i have an ACTIVEDIT WYSIYIG editor for people to use to put large amounts of HTMLtext and i write this information into a database.  on the website, i pull the information out from the database and the apostrophoes (single quotes) and quotations (double quotes) have become squares like this  after i finish writing to the database.  the information is stored as squares in the database itself.  does anyone know why and how to fix it?

in addition, most people copy the text from a word document or something to that effect and sometimes the quotes get converted to HTML code and sometimes it just stays as the squares.  are these a special code or character?
0
Comment
Question by:happydog234
[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 17

Expert Comment

by:anandkp
ID: 9880040
hmm common problem with most sites !

see if cfqueryparam can help u out in this - as it solves most of the " quotes " related problems.

also try & change the character lang set for ur DB - so it can take in "most" of the special characters & avoid those squares coming up !

with word it may be unavoidable in some cases ...

K'Rgds
Anand
0
 
LVL 1

Accepted Solution

by:
orangachang earned 500 total points
ID: 9905370
I've tried to solve this by converting the smart qoutes to regular CHR(34).  I find this happens when users copy & paste from MS-Word.

The following code is from a custom tag I wrote specifically for this:

<cfscript>
data = ReplaceNoCase(data,"&##x93;","&quot;","ALL");
data = ReplaceNoCase(data,"&ldquo;","&quot;","ALL");
data = ReplaceNoCase(data,"&lsquo;","'","ALL");
data = ReplaceNoCase(data,"&##x94;","&quot;","ALL");
data = ReplaceNoCase(data,"&rdquo;","&quot;","ALL");
data = ReplaceNoCase(data,"&rsquo;","'","ALL");
data = ReplaceNoCase(data,"&##x91;","'","ALL");
data = ReplaceNoCase(data,"&##x92;","'","ALL");
data = ReplaceNoCase(data,"&##x96;","-","ALL");
data = ReplaceNoCase(data,"&ndash;","-","ALL");
data = ReplaceNoCase(data,"“","&quot;","ALL");
data = ReplaceNoCase(data,"”","&quot;","ALL");
data = ReplaceNoCase(data,"‘","'","ALL");
data = ReplaceNoCase(data,"’","'","ALL");
data = ReplaceNoCase(data,"–","-","ALL");
</cfscript>
0

Featured Post

Business Impact of IT Communications

What are the business impacts of how well businesses communicate during an IT incident? Targeting, speed, and transparency all matter. Find out more in this infographic.

Question has a verified solution.

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

Suggested Solutions

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
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…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

751 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