improve the method of parseEncoding.
Merge pull request #14 from weihua/master

improve the method of parseEncoding.