using universalchardet to detect encoding. needs more work