Solved

Smart quotes, special charaters and apostrophe display on web

Posted on 2007-11-28
7
2,129 Views
Last Modified: 2008-11-21
We are having a problem with displaying smart quotes and apostrophes on the web particularly those coming from a database using SQL and coldfusion. Smart quotes are displaying as ý
Apostrophes are displaying as ?
I have tried <meta http-equiv="content-type" content="text/html; charset=utf-8" />
and <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
but neither of these seems to work.
Does anyone have any ideas about how to get these to display correctly.

0
Comment
Question by:cbeverly
[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
7 Comments
 
LVL 39

Accepted Solution

by:
gdemaria earned 500 total points
ID: 20368038

You can replace them with their non-microsoft equivalent..

Assuming your variable is called "myString"..
This will replace a handful of MS special characters..

<cfscript>
 myString = Replace(myString, chr(8217), chr(39),"ALL");
 myString = Replace(myString, chr(8216), chr(39),"ALL");
 myString = Replace(myString, chr(8220), chr(34),"ALL");
 myString = Replace(myString, chr(8221), chr(34),"ALL");
 myString = Replace(myString, chr(8211), "-","ALL");
</cfscript>

0
 
LVL 13

Expert Comment

by:R7AF
ID: 20368168
This is typically a character encoding problem. Can you tell us what the character encoding is you're using. I've had this situation when the character encoding of a page was UTF-8, data from SQL Server. When using character encoding ISO-8859-1 the problem was gone.

http://htmlhelp.com/tools/validator/charset.html.en
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">

Open in new window

0
 

Author Comment

by:cbeverly
ID: 20377089
Below is the code snippet I'm using. The first part is the actual code including quotes etc. And following is what actually displays.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
</head>
 
 
<body>
“Uncle Jack” Day created this brightly colored scene to show the moment when Adam and Eve were cast out from paradise. An angel flies down to greet the couple with an “eviction notice,” while their bleak future is spelled out in a note on the ground: “Gravy train gone. Adam settled down. Work hard in the barren land . . .” Dey copied the figures from a reproduction of Michelangelo’s Sistine Chapel ceiling, but instead of showing a large, threatening snake as their tempter, he painted a small creature that hides in the grass. (Lynda Hartigan, Made with Passion, 1990) The artist filled the painting with stripes and dabs of pure color to evoke Eden’s lush surroundings.
 
 
</body>
</html>
 
 
This displays as
�Uncle Jack� Day created this brightly colored scene to show the moment when Adam and Eve were cast out from paradise. An angel flies down to greet the couple with an �eviction notice,� while their bleak future is spelled out in a note on the ground: �Gravy train gone. Adam settled down. Work hard in the barren land . . .� Dey copied the figures from a reproduction of Michelangelo�s Sistine Chapel ceiling, but instead of showing a large, threatening snake as their tempter, he painted a small creature that hides in the grass. (Lynda Hartigan, Made with Passion, 1990) The artist filled the painting with stripes and dabs of pure color to evoke Eden�s lush surrounding

Open in new window

0
 

Author Comment

by:cbeverly
ID: 20377098
When I cut and pasted this code there were quotes in the code part but now when I view it, it is inserting strange characters in the code as well as the display
0
 
LVL 2

Expert Comment

by:TenTonJim
ID: 21015007
Make sure your text editor is set to UTF-8 also.
0

Featured Post

Create CentOS 7 Newton Packstack Running Keystone

A bug was filed against RDO for the installation of Keystone v3. This guide is designed to walk you through the configuration for using Keystone v3 with Packstack. You will accomplish this using various repos and the Answers file.

Question has a verified solution.

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

Find out what you should include to make the best professional email signature for your organization.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

623 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