Fixed generating payload with diacritic/multibyte characters

**size** returns number of characters but Apple expect size in bytes, so **size** will return too small number if multibyte characters are used.