Test for bug: Subclasses of string loses encoding