fix calculating content length for http post output to accommodate for utf8 special characters