Why is the external handling necessary? Why isn't just forcing the encoding of the string enough?