How to encode data in UTF8 format?