Skip to content
Advertisement

Why is mb_convert_encoding returning false?

Here is my code:

JavaScript

If I call the above function with $password = “abc123!”, mb_convert_encoding returns false.

Advertisement

Answer

According to PHP Manual

“auto” is expanded to “ASCII,JIS,UTF-8,EUC-JP,SJIS”

But in my case it did not work correctly. If I try the following code instead of 'auto' I get the expected result:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement