|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2014-09-30 02:07 UTC] requinix@php.net
 
-Status: Open
+Status: Not a bug
  [2014-09-30 02:07 UTC] requinix@php.net
  [2014-09-30 02:11 UTC] requinix@php.net
  [2014-09-30 02:23 UTC] zf at ancientrock dot org
  [2014-09-30 02:41 UTC] requinix@php.net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Sun Oct 26 15:00:01 2025 UTC | 
Description: ------------ mb_detect_encoding can not detect encoding rightly $str1 = hex2bin('e58da0e6a5bc'); $str2 = hex2bin('d5bcc2a5'); we want to detect encoding to see what's it! CP936? EUC-CN ? UTF-8? Test script: --------------- $str1 = hex2bin('e58da0e6a5bc'); $str2 = hex2bin('d5bcc2a5'); var_dump(mb_detect_encoding($str1, 'CP936', true)); var_dump(mb_detect_encoding($str1, 'EUC-CN', true)); var_dump(mb_detect_encoding($str1, 'UTF-8', true)); var_dump(mb_detect_encoding($str2, 'CP936', true)); var_dump(mb_detect_encoding($str2, 'EUC-CN', true)); var_dump(mb_detect_encoding($str2, 'UTF-8', true)); Expected result: ---------------- $str1 was UTF-8 encoding, $str2 was CP936 encoding. Actual result: -------------- All detect return true