php.net |  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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: whit at transpect dot com
New email:
PHP Version: OS:

 

 [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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 10:01:26 2024 UTC