DataIO: improve string serialization a bit