CP936 transcoding UTF-8 failed? How to deal with encoding in CP936 format

when uploading a file to obtain the file name encoding, the prompt is CP936 format

.
mb_detect_encoding($file_name, array("ASCII","GB2312","GBK","UTF-8"));

Baidu says that CP936 is actually GBK. But using

iconv("CP936", "UTF-8//IGNORE", $file_name);

when transcoding, the code is garbled, and the result is uploaded room.png . The original file name is queue. PNG
does not transcode, and it is also the name saved locally. PNG when directly saved locally.

I would like to ask how to transcode a file whose name is in the format of CP936 .

Mar.28,2021

you have used mb_detect_encoding , why not mb_convert_encoding ?


encounter the same problem, solve?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b39a6d-2b513.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b39a6d-2b513.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?