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
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: 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

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: Fri Apr 19 01:01:28 2024 UTC