Solved

wierd output after writing apostrophes to the database

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

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

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

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

763 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