Incorrect encoding in reference characters