Fixed errors about encodings and modified language display name detection.