fix content-length computation for UTF-8 strings