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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
32 + 6 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 03:01:29 2024 UTC