encode data passed into parse()

This assumes parse()/parse_from_model() are intended to accept
characters, not bytes.
Merge pull request #82 from tonycoz/scalar-chars

Encode data passed into parse().