Text viewer plugin: automatic encoding detection