use chtype
Merge pull request #17 from adrianob/use_chtype

use chtype