fix bug: can't deal with Chinese character
use default if encoding of view is undefined
Merge pull request #7 from jedy/master

Fixes to deal with Chinese characters