Subclasses of string loses encoding

When subclassing string, the deserialized object loses the encoding.
This is just the test, I really don't know where to fix this. Would be happy to do it if someone points me in the right direction...