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?Matti Virkkunen– Matti Virkkunen2010-04-14 17:51:01 +00:00Commented Apr 14, 2010 at 17:51
-
because it is not standard php4 functions and it not present on every server wit php4.termit– termit2010-04-17 11:08:58 +00:00Commented Apr 17, 2010 at 11:08
Add a comment
|
1 Answer
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?