Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8338063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:28:48+00:00 2026-06-09T04:28:48+00:00

I am in the process of amending my site to use UTF-8 encoding, this

  • 0

I am in the process of amending my site to use UTF-8 encoding, this is proving to be a bit of a pain. This is what I have done so far:

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

2) mysql_set_charset("utf8");

3) Set the character set of the database, table and column to utf8

Now I have some data in a field, the content of which is (the exact form):

<p>Tom & Jerry £5</p>

Upon outputting this data to the page, everything appears correct visually. However upon doing a HTML validation check, it fails on the & symbol, as it is not being changed to &amp;.

Now I tried to fix this by using htmlentities() but this encodes everything, including the angle brackets for the HTML Ptag. So it does not appear correctly. Furthermore the pound symbol appears with a weird character in front of it.

My question is, am I storing the data correctly in the database table? And if so, what do I need to do to ensure everything displays AND validates correct?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T04:28:50+00:00Added an answer on June 9, 2026 at 4:28 am

    Use htmlspecialchars instead of htmlentities when outputting UTF-8 text in a web page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This process has been using 65% of my site CPU and has lasted for
I'm in the middle of amending our data export process and was wondering whether
Current Process: I have a tar.gz file. (Actually, I have about 2000 of them,
Process.Start(IExplore.exe); Does this always work, on every machine ? If not, how to do
The process is explained here: http://msdn.microsoft.com/en-US/library/d1ae6tz5%28v=VS.80%29.aspx What I don't get from that article is
Every process can use heap memory to store and share data within the process.
A process is considered to have completed correctly in Linux if its exit status
My process is as follows: User logs into web app and this drops an
OCaml process can use just one core and in order to use multiple cores
// Process the forms if (($this->getRequest()->isPost()) && ($this->getRequest()->isXmlHttpRequest())) { // Initiate response $status =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.