php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49590 htmlentities doesn't convert euro symbols
Submitted: 2009-09-18 14:19 UTC Modified: 2009-09-18 17:50 UTC
From: fernando at consultorpc dot com Assigned:
Status: Not a bug Package: Strings related
PHP Version: 5.3.0 OS: Linux/Mac OSX Leopard
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: fernando at consultorpc dot com
New email:
PHP Version: OS:

 

 [2009-09-18 14:19 UTC] fernando at consultorpc dot com
Description:
------------
Htmlentities() doens't convert euro symbol correctly even when i set charset to ISO-8859-15.

Reproduce code:
---------------
<?php

$html = htmlentities( 'Euro ?' , ENT_COMPAT , 'ISO-8859-15' );
var_dump( $html );

Expected result:
----------------
"Euro &euro;"

Actual result:
--------------
"Euro &acirc;?&not;"

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-09-18 17:50 UTC] jani@php.net
That's incorrect as well since you're on UTF-8, this works:

# php -r 'var_dump(htmlentities("?", ENT_COMPAT, "UTF-8"));'
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri May 09 14:01:27 2025 UTC