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 34989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T14:09:54+00:00 2026-05-10T14:09:54+00:00

I did a lot of PHP programming in the last years and one thing

  • 0

I did a lot of PHP programming in the last years and one thing that keeps annoying me is the weak support for Unicode and multibyte strings (to be sure, natively there is none). For example, "htmlentities" seems to be a much used function in the PHP world and I found it to be absolutely annoying when you’ve put an effort into keeping every string localizable, only store UTF-8 in your database, only deliver UTF-8 webpages etc. Suddenly, somewhere between your database and the browser there’s this hopelessly naive function pretending every byte is a character and messes everything up.

I would just love to just dump this kind of functions, they seem totally superfluous. Is it still necessary these days to write ‘ä’ instead of ‘ä’? At least my Firefox seems perfectly happy to display even the strangest Asian glyphs as long as they’re served in a proper encoding.

Update: To be more precise: Are named entities necessary for anything else than displaying HTML tags (as in "&lt;" for "<")

Update 2:

@Konrad: Are you saying that, no, named entities are not needed?

@Ross: But wouldn’t it be better to sanitize user input when it’s entered, to keep my output logic free from such issues? (assuming of course, that reliable sanitizing on input is possible – but then, if it isn’t, can it be on output?)

  • 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. 2026-05-10T14:09:54+00:00Added an answer on May 10, 2026 at 2:09 pm

    Named entities in ‘real’ XHTML (i.e. with application/xhtml+xml, rather than the more frequently-used text/html compatibility mode) are discouraged. Aside from the five defined in XML itself (&lt;, &gt;, &amp;, &quot;, &apos;), they’d all have to be defined in the DTD of the particular DocType you’re using. That means your browser has to explicitly support that DocType, which is far from a given. Numbered entities, on the other hand, obviously only require a lookup table to get the right Unicode character.

    As for whether you need entities at all these days: you can pretty much expect any modern browser to support UTF-8. Therefore, as long as you can guarantee that the database, the markup and the web server all agree to serve that, ditch the entities.

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

Sidebar

Related Questions

I did a lot of searching and also read the PHP $_SERVER docs .
I did a lot of reading but I cannot answer one question I have
I'm working with some old PHP code that has a lot of the following:
I did a lot of Googling and was not able to find a PERFECT
Before asking this i did A LOT of searching on the net. I just
After searching a lot i did not get any answers and finally i had
There were a lot of promises and hopes, but did MS actually get around
I recently did a mailing to a lot of hotmail addresses and now all
Dear Ladys and Gentleman, I did my homework, I've googled a lot and I
I have a form on a page that sends data to php file via

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.