Some helper functions
More detailed error on Encoding and format code.
Merge pull request #9 from fromYukki/master

More detailed error and helper function