Bug #72752 [NEW]: mb_convert_encoding fails to convert chars from HTML-ENTITIES to some encodings

From: Date: Wed, 03 Aug 2016 23:45:58 +0000
Subject: Bug #72752 [NEW]: mb_convert_encoding fails to convert chars from HTML-ENTITIES to some encodings
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-202899@lists.php.net to get a copy of this message
From:             contact at amb dot tf
Operating system: Arch Linux
PHP version:      7.0.9
Package:          mbstring related
Bug Type:         Bug
Bug description:mb_convert_encoding fails to convert chars from HTML-ENTITIES to some encodings

Description:
------------
mb_convert_encoding fails to convert HTML-ENTITIES encoded chars to the
following encodings:

* BASE64
* Quoted-Printable
* 7bit


Test script:
---------------
<?php

foreach ([
    'BASE64',
    'UUENCODE',
    'HTML-ENTITIES',
    'Quoted-Printable',
    '7bit',
    '8bit',
] as $encoding) {
    echo "$encoding: ", mb_convert_encoding('&#x61;', $encoding,
'HTML-ENTITIES'), PHP_EOL;
}


Expected result:
----------------
BASE64: YQ==
UUENCODE: a
HTML-ENTITIES: a
Quoted-Printable: a
7bit: a
8bit: a


Actual result:
--------------
BASE64: JiN4NjE7
UUENCODE: a
HTML-ENTITIES: a
Quoted-Printable: &#x61;
7bit: &#x61;
8bit: a


-- 
Edit bug report at https://bugs.php.net/bug.php?id=72752&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=72752&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=72752&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=72752&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=72752&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=72752&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=72752&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=72752&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=72752&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=72752&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=72752&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=72752&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=72752&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=72752&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72752&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=72752&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=72752&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=72752&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=72752&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=72752&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=72752&r=mysqlcfg



Thread (2 messages)

« previous php.bugs (#202899) next »