警告mb_convert_encoding()未知编码“WINDOWS-1256”

getting error while converting windows-1256 in mb_convert_encoding():

Warning: mb_convert_encoding(): Unknown encoding "WINDOWS-1256" (K:/xampp/htdocs/master/trunk/__swift/includes/functions.php:715)

I know there is one alternative function iconv() by which I can resolved this problem but I know there must be some problem with iconv() aswell. I am digging into both of these, why and where these both are being use. any help would be highly appreciated.

There's no reason to believe that the error message is incorrect:

Unknown encoding "WINDOWS-1256"

You mention two functions:

  • Supported encodings for mb_convert_encoding() are listed in the PHP manual. There's no mention to Win-1256. They can also be obtained with the mb_list_encodings() function. It appears that you cannot use this extension with such encoding.

  • Supported encodings for iconv() are listed in the libiconv web site. There we can find CP1256. Yes, it's exactly the same encoding, but iconv() does not support the other alias (which is BTW the official IANA name).