#49231 [Opn]: iconv doenst handle iso-8859-15 well
| From: | jochem dot blok at fasterforward dot nl | Date: | Wed, 12 Aug 2009 11:45:13 +0000 |
| Subject: | #49231 [Opn]: iconv doenst handle iso-8859-15 well | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-140972@lists.php.net to get a copy of this message | ||
ID: 49231
User updated by: jochem dot blok at fasterforward dot nl
Reported By: jochem dot blok at fasterforward dot nl
Status: Open
Bug Type: ICONV related
Operating System: Windows XP
PHP Version: 5.2.10
New Comment:
When I try this:
<?
header('content-type: text/html; charset=ISO-8859-15');
echo
iconv('utf-8','ISO-8859-15',html_entity_decode(utf8_encode('€'),ENT_QUOTES,
'UTF-8'))
?>
It works in a browser. Debugging in Zend Studio gives the wrong
character. It seems that Zend Studio uses the editor encoding or
something like that. When I change the encoding (under Desktop) to
ISO-8859-15 it works!
Your snippet also gives a4, which is correct in both the browser and
Zend Studio.
It seems to be an Zend Studio issue :) Thanks for pointing me to the
solution.
Previous Comments:
------------------------------------------------------------------------
[2009-08-12 11:37:22] sjoerd-php at linuxonly dot nl
Thank you for your bug report.
I was unable to reproduce the problem. Are you sure that PHP outputs
the wrong character? It could be the tool you use to view the output has
a problem displaying the euro character. Try the following code:
echo bin2hex(iconv('utf-8','ISO-8859-15',
html_entity_decode('€',
null, 'UTF-8'))); // should output a4.
------------------------------------------------------------------------
[2009-08-12 10:30:38] jochem dot blok at fasterforward dot nl
Description:
------------
iconv doenst handle iso-8859-15 well. See
http://en.wikipedia.org/wiki/ISO/IEC_8859-15.
The reproduce code gives ¤
and that should be . Its seems that iconv converts to ISO-8859-1
Reproduce code:
---------------
echo
iconv('utf-8','ISO-8859-15',html_entity_decode(utf8_encode('€'),null,
'UTF-8'));
Expected result:
----------------
Actual result:
--------------
¤
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49231&edit=1