php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64659 Encode Error: accented chars returns empty string
Submitted: 2013-04-17 15:44 UTC Modified: 2013-04-17 17:06 UTC
From: luis dot pessoa67 at ibest dot com dot br Assigned:
Status: Not a bug Package: Strings related
PHP Version: 5.4.14 OS: Windows 7 SP1
Private report: No CVE-ID:
 [2013-04-17 15:44 UTC] luis dot pessoa67 at ibest dot com dot br
Description:
------------
1) First script
php -r "print(htmlentities('ú', ENT_COMPAT, 'ISO-8859-1'));"

results: ú
expected: ú
[OK]

2) Second script
php -r "print(htmlentities('ú'));"
results: 
expected: ú
[Error]

3) According documentation
quote_style: ENT_COMPAT (default)
charset: ISO-8859-1 (default)



---
From manual page: http://www.php.net/function.htmlentities#refsect1-function.htmlentities-returnvalues
---


Test script:
---------------
php -r "print(htmlentities('ú'));"

Expected result:
----------------
ú

Actual result:
--------------
string with lenght=0

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-04-17 15:54 UTC] luis dot pessoa67 at ibest dot com dot br
Environment Information:

System 	Windows NT LUIS 6.1 build 7601 (Windows 7 Business Edition Service Pack 1) i586
Build Date 	Apr 10 2013 21:15:43
Compiler 	MSVC9 (Visual C++ 2008)
Architecture 	x86
Configure Command 	cscript /nologo configure.js "--enable-snapshot-build" "--enable-debug-pack" "--disable-zts" "--disable-isapi" "--disable-nsapi" "--without-mssql" "--without-pdo-mssql" "--without-pi3web" "--with-pdo-oci=C:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8=C:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8-11g=C:\php-sdk\oracle\instantclient11\sdk,shared" "--with-enchant=shared" "--enable-object-out-dir=../obj/" "--enable-com-dotnet=shared" "--with-mcrypt=static" "--disable-static-analyze" "--with-pgo"
Server API 	CGI/FastCGI
Virtual Directory Support 	disabled
Configuration File (php.ini) Path 	C:\Windows
Loaded Configuration File 	C:\php\php.ini 

---------
my php.ini charset defs:

; PHP's built-in default is text/html
default_mimetype = "text/html"
default_charset = "iso-8859-1"
 [2013-04-17 15:59 UTC] luis dot pessoa67 at ibest dot com dot br
-Summary: Encoder Error: accented chars returns empty +Summary: Encode Error: accented chars returns empty string
 [2013-04-17 15:59 UTC] luis dot pessoa67 at ibest dot com dot br
I saw php 5.4.14 this bugs should be corrected (Fixed bug #64011).
 [2013-04-17 16:54 UTC] rasmus@php.net
The documentation clearly states:

5.4.0	 The default value for the encoding parameter was changed to UTF-8.
 [2013-04-17 16:54 UTC] rasmus@php.net
-Status: Open +Status: Not a bug
 [2013-04-17 17:06 UTC] luis dot pessoa67 at ibest dot com dot br
Tks for the answer, Ramus.

By the way the Brazilian Portuguese documentation are not updated. This is the reason for this ticket.

I saw there a lot of issues to updated related to html encoding.

Regards, Luis
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Wed Apr 23 09:02:23 2014 UTC