use Buffer class, encoding problem