encode option

- The secord argument of encode is object, can be string for compatible support
- whitespace option, default is false