Force strings into UTF-8 and get the correct payload length.