You can use $isutf()

Code:
if ($isutf($1-)) { echo -ag It's UTF-8 }
else { echo -ag It's Codepage. }


Returns 1 if the given string is UTF-8, otherwise returns 0.
It is undocumented... But yet it's there for you to use.


Nothing...