Fix 'Content-Length mismatch' error

Fixed byte length error for multi-byte characters.
Merge pull request #1 from hassansin/master

Fix 'Content-Length mismatch' error