|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #669 HTML entities stored as such retrieve as meta-ASCII
Submitted: 1998-08-19 09:38 UTC Modified: 1998-08-23 15:28 UTC
From: whit at transpect dot com Assigned:
Status: Closed Package: MySQL related
PHP Version: 3.0.1 OS: Linux
Private report: No CVE-ID: None
 [1998-08-19 09:38 UTC] whit at transpect dot com
I have a database where some of the strings contain HTML entities (such as "é"). When I used MySQL directly, it retrieves those entries correctly, showing the coding for the characters. However, PHP on retrieval converts them to the meta-ASCII equivalents ("?"). I know I can use htmlentities() to convert back - except that this doesn't work when I want to use the item for a furher MySQL search in cases like the entity above, since PHP will convert it back to "é" instead of "é", and then the string won't match. IMHO, the initial translation PHP is doing on retrieval from MySQL is inappropriate, since it both hinders further use of the string with MySQL, and isn't good HTML either - despite having been perfectly good HTML while sitting in the database.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [1998-08-23 15:28 UTC] zeev
The MySQL module doesn't do any sort of translation
upon retreiving items from the database, unless you have
magic quotes runtime turned on, in which case it escapes
the fetched string with backslashes.  Under no circumstances
are there any HTML entities converted one way or another.
Something probably breaking somewhere else.

If you can provide us with a short database dump and a
short script that uses it to reproduce the problem, we'd
be able to assist you (submit a new bug report).
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Jul 20 05:01:25 2019 UTC