Be safe_string compatible.

As per #89 request.
Maybe add read_string and write_string ?