Bug #81390 [NEW]: mb_detect_encoding() regression

From: Date: Thu, 26 Aug 2021 17:03:35 +0000
Subject: Bug #81390 [NEW]: mb_detect_encoding() regression
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-236093@lists.php.net to get a copy of this message
From:             alec at alec dot pl
Operating system: 
PHP version:      8.1.0beta3
Package:          mbstring related
Bug Type:         Bug
Bug description:mb_detect_encoding() regression

Description:
------------
The same code returns "ISO-8859-1" on PHP8.0 and "UUENCODE" on
PHP8.1.0beta3.

Note: the text contains some ascii with two 0x0EB characters
Note: ISO-8859-1 is before UUENCODE in the mb_list_encodings() result.
Note: Even removing UUENCODE from the list does not make it to return
expected ISO-8859-1

Test script:
---------------
$test = base64_decode('Q0hBUlNFVD13aW5kb3dzLTEyNTI6RG/rO0pvaG4=');

echo mb_detect_encoding($test, mb_list_encodings());

Expected result:
----------------
ISO-8859-1

Actual result:
--------------
UUENCODE

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


Thread (37 messages)

« previous php.bugs (#236093) next »