Detect text encoding in php