fix surrogate pair in read_line function