getbytes sending properly encoded data