I need to convert the character encoding of string str to UTF-8 from any encoding in PHP.
This code:
$string = mb_convert_encoding($sring, “utf-8”, “auto”);
sometimes returns warning: “mb_convert_encoding(): Unable to detect character encoding”
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It is impossible to correctly guess the charset for any arbitrary text 100% of the time. Examine the source for clues to the charset (META tag, HTTP header, etc.).