Solved

wierd output after writing apostrophes to the database

Posted on 2003-12-04
2
223 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
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

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 …
A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

862 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

23 Experts available now in Live!

Get 1:1 Help Now