Solved

Smart quotes, special charaters and apostrophe display on web

Posted on 2007-11-28
7
2,125 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to create a table with buttons 3 31
Set time on Session (ASP) 14 30
ASP.net Markup for Sub Menu 2 42
CSS for <center> 14 34
When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

749 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