Merge pull request #32 from bay6/master

encoding
handle exception