Doc #60210 [Opn->Asn]: Example is not correct, as german Umlaut gets also encoded
| From: | raphaelm@php.net | Date: | Thu, 03 Nov 2011 13:09:26 +0000 |
| Subject: | Doc #60210 [Opn->Asn]: Example is not correct, as german Umlaut gets also encoded | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-7384@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=60210&edit=1
ID: 60210
Updated by: raphaelm@php.net
Reported by: fgunni at 01019freenet dot de
Summary: Example is not correct, as german Umlaut gets also
encoded
-Status: Open
+Status: Assigned
Type: Documentation Problem
Package: Translation problem
PHP Version: 5.3.8
-Assigned To:
+Assigned To: raphaelm
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2011-11-03 13:04:58] fgunni at 01019freenet dot de
Description:
------------
---
From manual page: http://www.php.net/function.htmlentities#refsect1-function.htmlentities-examples
---
Umlaut (ü => ü) also gets encoded.
Wrong:
<?php
$str = "Ein 'Anführungszeichen' ist <b>fett</b>";
// Gibt aus: Ein 'Anführungszeichen' ist <b>fett</b>
echo htmlentities($str);
// Gibt aus: Ein 'Anführungszeichen' ist
<b>fett</b>
echo htmlentities($str, ENT_QUOTES);
?>
Correct:
<?php
$str = "Ein 'Anführungszeichen' ist <b>fett</b>";
// Gibt aus: Ein 'Anführungszeichen' ist <b>fett</b>
echo htmlentities($str);
// Gibt aus: Ein 'Anführungszeichen' ist
<b>fett</b>
echo htmlentities($str, ENT_QUOTES);
?>
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=60210&edit=1