set content length correctly for unicode