fix wide char unicode string serialization

Fix from cforger in GitHub issue #8.