fix cat codec problem
Merge pull request #51 from youyong205/master

fix cat codec problem
Merge pull request #54 from unidal/master

big code refactory