Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Warning mb_convert_encoding() Unknown 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.

like image 695
Ravi Sharma Avatar asked Jun 03 '26 14:06

Ravi Sharma


1 Answers

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).

like image 133
Álvaro González Avatar answered Jun 06 '26 02:06

Álvaro González



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!