added charset support
Merge pull request #3 from oldcai/master

Added charset detector for code