Fix to support data with different encodings