1

How I can detect string encoding without mb_* and iconv functions in php4

2
  • 1
    ...why do you want to detect encoding without using any of the encoding functions? Commented Apr 14, 2010 at 17:51
  • because it is not standard php4 functions and it not present on every server wit php4. Commented Apr 17, 2010 at 11:08

1 Answer 1

1

I don't understand, wouldn't you just use the function:

/* Detect character encoding with current detect_order */
echo mb_detect_encoding($str);

/* "auto" is expanded to "ASCII,JIS,UTF-8,EUC-JP,SJIS" */
echo mb_detect_encoding($str, "auto");

/* Specify encoding_list character encoding by comma separated list */
echo mb_detect_encoding($str, "JIS, eucjp-win, sjis-win");

As described in the PHP.net manual?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.