Auto detect encoding and convert to koi8, CP-1251 or cp866