Jump to content

UTF-8 characters displayed as �


Greywacke
 Share

Recommended Posts

hi again,this problem has resurfaced and i am not sure how. the database contains the characters represented by the “ and ” html entities, but the xml is returning them both as � despite being defined as

<?xml version="1.0" encoding="utf-8"?>

this has even been tried as

<?xml version="1.0" encoding="UTF-8"?>

with the xhtml 1.0 document having

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

in the header and

accept-charset="utf-8"

as a form attribute.should they all be UTF-8 or utf-8, if not - where should they be which?

Link to comment
Share on other sites

i've attempted following the recommendation in a kirupa forum post, but to no avail.even with the encoding set in the header, both the left and right double quotes are displayed as �. perhaps i need to replace them with the html entities?well this did not work. “ and ” are not recognised xml entities. neither do the characters want to display on a utf-8 encoded xml document. :/starting to lose my focus again, please help!

Edited by Pierre 'Greywacke' du Toit
Link to comment
Share on other sites

utf-8but i have found the entities to be displayed, and they display as the characters no longer that question mark in the square character.i just had to replace the left and right slanting double quotes with “ and ”.issue resolved! :)

Edited by Pierre 'Greywacke' du Toit
Link to comment
Share on other sites

The numeric entities are only required if you have the character encoding wrong. If you have it right, you can write the cahracter literaly, with no entity of any kind.Are you absolutely sure that your file is encoded as UTF-8? If you open Notepad and click "Save As...", do you see "UTF-8" in the encoding dropdown? If not, set it.Other than that, the header() line from the forum post you linked to is the critical part, only replacing "text/xml" with "text/html".

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...