add config of encoding

Signed-off-by: yorelog <yorelog@gmail.com>