Solved

qoutes don't display correctly on page after change to  charset=utf-8

Posted on 2014-11-19
4
109 Views
Last Modified: 2014-11-20
When I copy text from wordperfect the single and double quotes don't display properly. I know there is a setting in wordperfect for the world wide web that will fix this, but not everyone who uploads to my site is going to change that setting.

I recently changed the meta tag which caused this trouble.
was:  charset=ISO-8859-1
now:  charset=utf-8

Is there a common fix for this? thanks.
0
Comment
Question by:kadin
  • 2
4 Comments
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 250 total points
ID: 40454329
WordPerfect and Word use what are called 'smart quotes' which are in the Latin1/Windows1252/ISO-8859-1 character sets in the same code positions.  UTF8 puts them somewhere else.  If you want to use UTF8 then you will have to translate the 'smart quotes'.  There is a routine on this page http://shiflett.org/blog/2005/oct/convert-smart-quotes-with-php to do that.
0
 
LVL 109

Assisted Solution

by:Ray Paseur
Ray Paseur earned 250 total points
ID: 40454785
This is a character set encoding issue.  This article explains what is happening and what you can do about it.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_11880-Unicode-PHP-and-Character-Collisions.html
0
 

Author Comment

by:kadin
ID: 40456443
Thank you both for your responses.

I can't replicate the problem and therefore cannot test your solutions. The problem started when I changed meta data in header:

was:  charset=ISO-8859-1
now:  charset=utf-8

Text that was already in database from one of my users started displaying on web page with ? instead of "" and ''. When I copy that same text from database and re-upload it to new row in DB. and then display on new web page, the quotes display like non-computer (made for paper) quotes, that is, they look just fine (displayed at a slant instead of replaced with a question mark), and would print on paper well, which is what word perfect is designed for - as you know computer quotes display vertically instead of a slant.

I created slanted quotes in wordperfect and upload and they display just fine.
I am starting to wonder if there is no problem. Maybe only text that was uploaded during when charset=ISO-8859-1 was in charge will display with ?. But now that charset=utf-8 is in charge, any NEW uploads of old style made for paper quotes from wordperfect for example, will be formatted upon upload and display just fine.

Ray, I tested your test characters, and they display just fine.

'Françoise'
, 'Å-Ring'
, 'ßeta or Beta?'
, 'Öh löök, umlauts!'
, 'ENCYCLOPÆDIA'
, 'ça va! mon élève mi niña?'
, 'A stealthy ƒart'
, 'Ðe lónlí blú bojs'
0
 

Author Comment

by:kadin
ID: 40456553
I copied the problem text from one column to another and it displays bad. I copy that same problem text to an upload form and then display it and it displays good. It looks like anything uploaded from this point on using utf-8 will display good, there fore problem solved. Thanks for your help.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PHP and google maps 13 44
javascript: add id amounts 5 46
Attach to file (img) a unique id 8 24
What does $selected = $month == $beginning_month ? 'selected' : ''; mean? 5 27
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

776 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