« Coder avec Unicode/Conversion » : différence entre les versions

Contenu supprimé Contenu ajouté
Ligne 43 :
| <source lang=php>print htmlspecialchars_decode(htmlentities($chaine, ENT_NOQUOTES, 'UTF-8'));</source> || <source lang=html>é é $ €</source> || <source lang=html>é é $ €</source>
|-
| <source lang=php>print mb_convert_encoding($chaine, 'HTML-ENTITIES', 'UTF-8');</source> || <source lang=html>é é $ €</source> || <source lang=html>...</source>
|-
| <source lang=php>print json_encode($chaine);</source> || <source lang=html>é \u00e9 $ \u20ac</source> || <source lang=html>...</source>
|-
| <source lang=php>print json_encode($chaine, JSON_UNESCAPED_UNICODE);</source> || <source lang=html>é é $ €</source> || <source lang=html>...</source>
|}