Semi-automatic detection of input encoding
