add support for non-unicode charsets(such as GBK, GB2312...)